-
Notifications
You must be signed in to change notification settings - Fork 4
Alternate AIP-193 recommendation #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
2ee6e9b
0908529
568e0fc
1519d97
40cff57
1aa3dee
9172c51
6233a69
421a3fd
2626d27
1c083f9
77ee548
e66cf0d
c499945
214fac2
dcc55d8
3cf2ce2
97eb647
1de2d49
10c62b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,9 @@ than being expected to constantly add verbose error handling everywhere. | |
|
|
||
| Services **must** clearly distinguish successful responses from error responses | ||
| by using appropriate HTTP codes: | ||
| - Informational responses **must** use HTTP status codes between 100 and 199. | ||
| - Successful responses **must** use HTTP status codes between 200 and 399. | ||
| - Informational responses issued on a provisional basis while request processing continues **must** use HTTP status codes between 100 and 199. | ||
| - Successful responses **must** use HTTP status codes between 200 and 299. | ||
| - HTTP status codes between 300 and 399 **must** be used to indicate further action like URL redirection needs to be taken in order to complete the request. | ||
| - Errors indicating a problem with the user's request **must** use HTTP status | ||
| codes between 400 and 499. | ||
| - Errors indicating a problem with the server's handling of an valid request | ||
|
|
@@ -37,15 +38,17 @@ interface Error { | |
| // A unique identifier that identifies the specific occurrence of the problem. Can be provided to the API owner for debugging purposes. | ||
| id?: string | ||
|
|
||
| // An array of additional error details. errors?: any[] | ||
| // A map of metadata returning additional error details that can be used programmatically | ||
| metadata?: dict<string, any> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The schema of metadata should be documented and a change in this schema could mean a breaking change.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shwoodard: The schema of metadata should be fixed per |
||
| } | ||
|
|
||
|
|
||
| - The `title` field is intended for consumption by humans, and therefore | ||
| **may** change, even within a single version. | ||
| - The `code` field is intended to have code written against it, and therefore | ||
| **must not** change. Values for this field should be 0-63 characters, and use | ||
| only lower-case letters, numbers, and the `-` character. | ||
| only lower-case letters, numbers, and the `-` character. These strings should | ||
| be comparable using ordinal comparisons. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean? What kind of "ordinal comparisons", and for what purpose?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added "ordinal comparison" here per @jskeet's feedback: #45 (comment) What that would mean here is each a developer should send stable error codes that can always be compared to the exact same numeric character values. For example, an API shouldn't send That said, given we're recommending developers to always send lower-case letters here. I'm curious if we need that anymore? @jskeet thoughts?
saurabhsahni marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id?: stringinstead ofinstance?: string, format: uri-referenceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternate options:
errorInstanceIdtraceIdrequestIdoccurrenceIdConsensus was to use
occurrenceId.id,errorIdcould be confused as an id unique for this errortypeinstead of the specific occurrence. `