Skip to content
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

Standardize all error messages #30

Open
georgevanvliet opened this issue May 13, 2020 · 0 comments
Open

Standardize all error messages #30

georgevanvliet opened this issue May 13, 2020 · 0 comments

Comments

@georgevanvliet
Copy link

Suggested format:

{
  "error": "some_immutable_error_enum_string_so_we_can_differentiate",
  "message": "This could contain some detail, and can be different for each invocation",
}

No need to add the http status code, since that's already in the response.

If you want to keep the possibility open for multiple errors, if applicable, you can decide to always return an array of errors such as:

[
  {
    "error": "some_error",
    "message": "some message",
  },
    "error": "some_other_error",
    "message": "some other message",
  },
]

But if you do, please always return errors an array for all calls, even if there is only one error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant