Closed Bug 1507329 Opened 7 years ago Closed 7 years ago

Remove catch all "Exception" error handler from Lando UI

Categories

(Conduit :: Lando, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: smacleod, Assigned: imadueme)

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

Right now Lando UI has a catch all error handler registered for any uncaught "Exception"[1]. This recently caused an issue by nuking redirect exceptions that werkzeug was passing up, and was fixed by special casing these redirect exceptions[2]. Rather than having a custom error handler for bare exceptions, we should be adding a custom error handler for "500", which will be caused by an uncaught exception (assuming it isn't a special exception flask/werkzeug uses). Details can be found in the Flask documentation[3]. [1] https://github.com/mozilla-conduit/lando-ui/blob/24f53efbd79266a4a5d4616d01e8aa66240c8a4e/landoui/errorhandlers.py#L137 [2] https://phabricator.services.mozilla.com/D10978 [3] http://flask.pocoo.org/docs/1.0/patterns/errorpages/#error-handlers
Assignee: nobody → imadueme
Flask knows how to handle some Exceptions, but, we were catching those without giving the flask app a chance to handle them appropriately. In the past there was some confusion, since unit tests would fail when using a 500 code handler, but, pass when explictly catching all Exceptions. The catch all Exception handler was left, but, then we were having to manually determine which exceptions to catch vs which to pass back to flask. Here we use the proper 500 code handler which will catch all exceptions that flask doesn't know how to handle, and we update the unit tests to disable the TESTING and DEBUG flags when testing this behavior. When those flags are set, flask doesn't handle any exceptions - useful for a dev or testing enviroment, but, not when testing that exact scenario! See http://flask.pocoo.org/docs/1.0/patterns/errorpages/#error-handlers
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: