Skip to content

Commit

Permalink
CORE-1182: updated the contribution guidelines document to mention th…
Browse files Browse the repository at this point in the history
…e `error_code` field in error response bodies
  • Loading branch information
slr71 committed Jan 14, 2021
1 parent 4d3b71a commit 9ce89ef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contribution-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ like this:

``` JavaScript
{
"message": "error details here"
"message": "error details here",
"error_code": "ERR_SOMETHING_BAD_HAPPENED"
}
```

Additional fields may be present, but the `message` field should always be included. Note that this is the default error
response body format used by [labstack/echo][10].
The `message` field should always be included so that users can look at the response body and know what went wrong. In
cases where it might be useful for an automated client to examine the error and respond appropriately, it's useful to
have the `error_code` field present as well. (This field does break the `camelCase` convention mentioned above, but it's
already in use in several places.) Additional fields may be present as well. The default response body format used by
[labstack/echo][10] is the same, but the `error_code` field is not present.

## Performance

Expand Down

0 comments on commit 9ce89ef

Please sign in to comment.