diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index 3ca5beebe..688477faf 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -97,6 +97,7 @@ class QommonPublisher(Publisher): missing_appdir_redirect = None use_sms_feature = True app_translations = dict() + statsd = None def get_root_url(self): if self.get_request(): @@ -250,7 +251,8 @@ class QommonPublisher(Publisher): original_response = request.response request.response = HTTPResponse() - self.statsd.increment('failed-request') + if self.statsd: # maybe unset if very early failure + self.statsd.increment('failed-request') (exc_type, exc_value, tb) = sys.exc_info()