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

Add API errors to API Docs #54

Open
Cryptophobia opened this issue Mar 20, 2018 · 2 comments
Open

Add API errors to API Docs #54

Cryptophobia opened this issue Mar 20, 2018 · 2 comments

Comments

@Cryptophobia
Copy link
Member

From @Joshua-Anderson on June 20, 2016 18:53

Right now, we don't document any of the errors that the API can return on an request, making it difficult for people trying to build in error handling for the api.

Even if we don't document every error, just documenting the format of the error messages makes it easier for people to parse them.

For example: POST /v2/auth/register/ with no body returns 400 with a body of

{
  "username": [
    "This field is required."
  ],
  "password": [
    "This field is required."
  ]
}

Copied from original issue: deis/workflow#334

@Cryptophobia
Copy link
Member Author

From @bacongobbler on October 12, 2016 16:18

I'm pretty sure we did not decide to go through with this because of the amount of ambiguous errors that can pop up not only from the ones we define, but from DRF or from python itself. Do you agree, @Joshua-Anderson?

@Cryptophobia
Copy link
Member Author

From @Joshua-Anderson on October 12, 2016 20:59

I'm not sure defining every error is feasible, but defining at least some of the common errors can be helpful. There are a several errors that can come up through no fault of the API client itself, like the all apps must be transferred before deleting a user error, the API clients should know how to handle.

The big problem is that we have several error response formats (since python, DRF, and deis errors all look different), so it's hard for a client to assume what an error message will look like.

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