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

Update error handling on APIHandlers #2853

Merged
merged 4 commits into from
Sep 25, 2017
Merged

Update error handling on APIHandlers #2853

merged 4 commits into from
Sep 25, 2017

Conversation

minrk
Copy link
Member

@minrk minrk commented Sep 21, 2017

  • Raise 403 on unauthenticated API requests
    instead of redirecting to login page, which doesn't make sense for API handlers
    and can cause undesirable side effects when using custom login handlers as in JupyterHub
    (Redirect to login url on mismatched oauth state jupyterhub/jupyterhub#1438).
  • deprecate @json_errors decorator with write_error method
    on APIHandler, which is the natural and more robust place to implement custom error handling in Tornado.

instead of redirecting to human login page, which can have side effects
…or messages

this is the standard tornado way to do it, and catches errors at the `prepare` stage, which method decorators do not
Copy link
Member

@takluyver takluyver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I'll leave it for a day or so in case others want to have a look.

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

Successfully merging this pull request may close these issues.

4 participants