From 2519ebff9d3d5904895bca3e0dd14db3eb1e5bde Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 6 Nov 2017 17:48:13 -0500 Subject: [PATCH] Tweaked exception-handling middleware to preserve tracebacks --- netbox/utilities/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/utilities/middleware.py b/netbox/utilities/middleware.py index 2909acfa7..927855e0e 100644 --- a/netbox/utilities/middleware.py +++ b/netbox/utilities/middleware.py @@ -57,9 +57,9 @@ class ExceptionHandlingMiddleware(object): def process_exception(self, request, exception): - # Raise exceptions if in debug mode + # Don't catch exceptions when in debug mode if settings.DEBUG: - raise exception + return # Determine the type of exception if isinstance(exception, ProgrammingError):