persephone-tools / persephone-web-API

Web API for use with the Persephone library
GNU Affero General Public License v3.0
8 stars 2 forks source link

Deal with 500 errors properly #142

Closed shuttle1987 closed 5 years ago

shuttle1987 commented 5 years ago

Currently 500 errors are not specified in the API spec and also are not being provided in the standard error format either.

shuttle1987 commented 5 years ago

Given the changes in PR #158 I'm going to strike this off the pre-workshop work as much of this issue is fixed now.

shuttle1987 commented 5 years ago

So the way to handle this is to do something like:

@app.errorhandler(500)
def internal_error(error):
    """Handles 500 errors"""
    ...

But I'm just not sure how to test this as nothing should actually raise this error in operation.