From 3e650350c78c30435813ba95a51a0864cf04c045 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Fri, 27 Apr 2018 14:32:14 +0200 Subject: [PATCH] Specify exception class to be caught --- instana/django.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instana/django.py b/instana/django.py index fdc16156..b83ee0db 100644 --- a/instana/django.py +++ b/instana/django.py @@ -35,7 +35,7 @@ def process_request(self, request): span.set_tag(ext.HTTP_METHOD, request.method) span.set_tag("http.host", env['HTTP_HOST']) self.span = span - except as e: + except Exception as e: logger.debug("Instana middleware @ process_response: ", e) def process_response(self, request, response): @@ -51,7 +51,7 @@ def process_response(self, request, response): internal_tracer.inject(self.span.context, ot.Format.HTTP_HEADERS, response) self.span.finish() self.span = None - except as e: + except Exception as e: logger.debug("Instana middleware @ process_response: ", e) finally: return response