# HG changeset patch # User Marcin Kuzminski # Date 2017-01-13 16:24:05 # Node ID ed9a1494a98ada0ceb6777469a896f078b126d78 # Parent 771d647d33e391095a5bd955f93dac8924728d22 http: added catch-all exception handler to show errors in logs. diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -207,6 +207,10 @@ class HTTPApplication(object): self.handle_vcs_exception, context=Exception, custom_predicates=[self.is_vcs_exception]) + self.config.add_view( + self.general_error_handler, context=Exception) + + def wsgi_app(self): return self.config.make_wsgi_app() @@ -359,6 +363,12 @@ class HTTPApplication(object): # Re-raise exception if we can not handle it. raise exception + def general_error_handler(self, exception, request): + log.exception( + 'error occurred handling this request for path: %s', + request.path) + raise exception + class ResponseFilter(object):