Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Created April 19, 2019 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfhbrook/811cbabd4bdc6d58f39592adffdd0b7a to your computer and use it in GitHub Desktop.
Save jfhbrook/811cbabd4bdc6d58f39592adffdd0b7a to your computer and use it in GitHub Desktop.
A snippet from the data team's API framework used to handle exceptions
def http_error_handler(exc):
"""
error handler intended for werkzeug HTTPException instances
"""
uid = log_and_generate_uid(exc)
code = kinja_error_code_from_exc(exc)
return error(exc, exc_code=code, uid=uid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment