Created
April 19, 2019 21:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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