Skip to content

Commit e74b2e5

Browse files
committed
Propagate exceptions and remove now-redundant @api.errorhandler
1 parent 4afbb1b commit e74b2e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dat_backend/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
cache = Cache(config={"CACHE_TYPE": "SimpleCache", "CACHE_DEFAULT_TIMEOUT": 60})
4343
cache.init_app(app)
4444

45+
# Required for the error handler below to work correctly.
46+
app.config.update({"PROPAGATE_EXCEPTIONS": True})
47+
4548

46-
# Note: both deocrators are necessary or this function will not work in non-dev
47-
# environments.
4849
@app.errorhandler(Exception) # noqa
49-
@api.errorhandler # noqa
5050
def handle_exception(e):
5151
"""Handle any exceptions raised from the application.
5252

0 commit comments

Comments
 (0)