diff --git a/trac/web/main.py b/trac/web/main.py index 32f8c480e5..8a1697c3bf 100644 --- a/trac/web/main.py +++ b/trac/web/main.py @@ -286,9 +286,13 @@ def dispatch(self, req): except RequestDone: pass except Exception as e2: - self.log.error("Exception caught while post-processing" - " request: %s", - exception_to_unicode(e2, traceback=True)) + if isinstance(e, TracError): + self.log.warning("Exception caught while post-processing" + " request: %s", exception_to_unicode(e2)) + else: + self.log.error("Exception caught while post-processing" + " request: %s", + exception_to_unicode(e2, traceback=True)) if isinstance(e, PermissionError): raise HTTPForbidden(e) if isinstance(e, ResourceNotFound):