Unregister "Exception" from flask handler

Unregister the default Exception from the flask error handler. This
is to allow flask 404 to bubble up outside of test cases normally with
out raising a 500 error.

Change-Id: I2159952acae0234472ee3fea7f387278cbefa6c3
Closes-Bug: #1800124
This commit is contained in:
Morgan Fainberg
2018-10-29 08:26:31 -07:00
parent d9432328c9
commit ee490d8226
2 changed files with 19 additions and 3 deletions

View File

@@ -134,10 +134,9 @@ def application_factory(name='public'):
app.register_error_handler(exc, _handle_keystone_exception)
# Register extra (python) exceptions with the proper exception handler,
# specifically TypeError and generic exception, these will render as
# 500 errors, but presented in a "web-ified" manner
# specifically TypeError. It will render as a 400 error, but presented in
# a "web-ified" manner
app.register_error_handler(TypeError, _handle_unknown_keystone_exception)
app.register_error_handler(Exception, _handle_unknown_keystone_exception)
# Add core before request functions
app.before_request(req_logging.log_request_info)