Skip to content

Commit

Permalink
Improve Error description
Browse files Browse the repository at this point in the history
This improves the description of the Error model by indicating that
error messages must be unique and cannot have contextual information.
  • Loading branch information
matheusd committed Jul 20, 2020
1 parent 9d49df3 commit 60ca23f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.json
Expand Up @@ -1722,7 +1722,7 @@
}
},
"Error": {
"description":"Instead of utilizing HTTP status codes to describe node errors (which often do not have a good analog), rich errors are returned using this object.",
"description":"Instead of utilizing HTTP status codes to describe node errors (which often do not have a good analog), rich errors are returned using this object. Both the code and message fields can be individually used to correctly identify an error. Implementations MUST use unique values for both fields.",
"type":"object",
"required": [
"code",
Expand All @@ -1738,7 +1738,7 @@
"example": 12
},
"message": {
"description":"Message is a network-specific error message.",
"description":"Message is a network-specific error message. The message MUST NOT change for a given code. In particular, this means that any contextual information should be included in the details field.",
"type":"string",
"example":"Invalid account format"
},
Expand Down
8 changes: 8 additions & 0 deletions models/Error.yaml
Expand Up @@ -15,6 +15,10 @@
description: |
Instead of utilizing HTTP status codes to describe node errors (which often
do not have a good analog), rich errors are returned using this object.
Both the code and message fields can be individually used to correctly
identify an error. Implementations MUST use unique values for both
fields.
type: object
required:
- code
Expand All @@ -32,6 +36,10 @@ properties:
message:
description: |
Message is a network-specific error message.
The message MUST NOT change for a given code. In particular, this
means that any contextual information should be included in
the details field.
type: string
example: "Invalid account format"
retriable:
Expand Down

0 comments on commit 60ca23f

Please sign in to comment.