Consistent API error messages
@vpanjganj 已经在做这个了。
开始于 2018年11月22日。
评估
这个 Issue 还没有评估数据。
描述
Hello,
Recently we discussed in the Topcoder Community, and people have different opinions regarding errors messages.
From your best practices:
Response messages must be self-descriptive. A good error message response might look something like this:
// (1)
{
"code": 1234,
"message" : "Something bad happened",
"description" : "More details"
}
or for validation errors:
// (2)
{
"code" : 2314,
"message" : "Validation Failed",
"errors" : [
{
"code" : 1233,
"field" : "email",
"message" : "Invalid email"
},
{
"code" : 1234,
"field" : "password",
"message" : "No password provided"
}
]
}
Based on my understanding, (1) schema can be used as a general error format, and (2) schema can be used for a specific situation (validation errors in this case).
That means error responses don't have to have the exact format with the same properties.
Some developers insist that all error responses should be consistent and be the same.
Could you clarify it according to your best practices in this project?
- 主要语言
- JavaScript
- 星标
- 29.4k
- 派生
- 3.1k
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
elsewhencode/project-guidelines 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
elsewhencode/project-guidelines#176 · 1 条评论 ·
-
improvement
elsewhencode/project-guidelines#160 · 3 个 reaction · 已指派 1 人 ·
-
improvement
elsewhencode/project-guidelines#140 · 已指派 1 人 ·
-
help wanted improvement
elsewhencode/project-guidelines#124 · 2 条评论 · 6 个 reaction · 已指派 1 人 ·
-
suggestion
elsewhencode/project-guidelines#111 · 1 条评论 · 3 个 reaction · 已指派 1 人 ·
查看 elsewhencode/project-guidelines 的全部 Issue
相似的 Issue
-
curation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
amponce/archive-movie-browser#186 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
clerk/javascript#9852 ·
-
bug p1 tools
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 84/100