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

Rejig ExceptionMiddleware and ServerErrorMiddleware #193

Merged
merged 4 commits into from
Nov 8, 2018

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Nov 7, 2018

Closes #190

  • Rejigs exception handling, so managed exceptions do not get seen as errors by the middleware stack.
  • Adds support for status code handlers
@app.exception_handler(404)
async def not_found(request, exc):
    ...

TODO:

  • Update docs.
  • DebugMiddleware -> ServerErrorMiddleware(app, debug: bool)

@tomchristie tomchristie merged commit 9f3dcb7 into master Nov 8, 2018
@tomchristie tomchristie deleted the rejig-middleware branch November 8, 2018 11:59
@vishes-shell
Copy link

You left commented out test cases for exceptions. That code could probably start to smell in future...

@tomchristie
Copy link
Member Author

@vishes-shell Thanks! Now resolved.

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

Successfully merging this pull request may close these issues.

2 participants