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

Report Internal Server Errors in a standard way #110

Open
Glutexo opened this issue Jan 22, 2019 · 0 comments
Open

Report Internal Server Errors in a standard way #110

Glutexo opened this issue Jan 22, 2019 · 0 comments

Comments

@Glutexo
Copy link
Collaborator

Glutexo commented Jan 22, 2019

When an Internal Server Error occurs, the response should still a valid error JSON. Now, the response is an HTML document:

<html>
<head>
    <title>Internal Server Error</title>
</head>
<body>
<h1><p>Internal Server Error</p></h1>

</body>
</html>

The error should be in the same format that Connexion emits on failure. Content-Type is application/problem+json and it looks like this:

{
  "detail": "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.",
  "status": 403,
  "title": "Forbidden",
  "type": "about:blank"
}

I expect that this can be fixed by setting up a Flask error handler. It might be even possible to use the Connexion’s error handler instead of just mimicking its format.

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

No branches or pull requests

1 participant