Catch exceptions in various locations to fix small issues reported by Sentry.

This commit is contained in:
grossmj committed 2018-09-06 09:49:12 +02:00
1 parent 341e2e2e3a
commit 4021a13651
8 files changed
+63 -40

No files matched your search

+5
View File
@@ -225,6 +225,11 @@ class Route(object):
response = Response(request=request, route=route)
response.set_status(408)
response.json({"message": "Client error", "status": 408})
except MemoryError:
log.error("Memory error detected, server has run out of memory!", exc_info=1)
response = Response(request=request, route=route)
response.set_status(500)
response.json({"message": "Memory error", "status": 500})
except Exception as e:
log.error("Uncaught exception detected: {type}".format(type=type(e)), exc_info=1)
response = Response(request=request, route=route)