summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-11-27 12:07:52 +0000
committerGitHub <noreply@github.com>2017-11-27 12:07:52 +0000
commit96387bd26f39a6ffc0903ee35ae761a3110fa077 (patch)
tree11b163a4d5f5ce4d6a0351a1bafdcd1b2ef92558 /synapse/http
parentMerge pull request #2701 from matrix-org/rav/one_mediarepo_to_rule_them_all (diff)
parentImprove tracebacks on exceptions (diff)
downloadsynapse-96387bd26f39a6ffc0903ee35ae761a3110fa077.tar.xz
Merge pull request #2705 from matrix-org/rav/improve_tracebacks
Improve tracebacks on exceptions
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/server.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 3ca1c9947c..25466cd292 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -28,6 +28,7 @@ from canonicaljson import (
 )
 
 from twisted.internet import defer
+from twisted.python import failure
 from twisted.web import server, resource
 from twisted.web.server import NOT_DONE_YET
 from twisted.web.util import redirectTo
@@ -131,12 +132,17 @@ def wrap_request_handler(request_handler, include_metrics=False):
                             version_string=self.version_string,
                         )
                     except Exception:
-                        logger.exception(
-                            "Failed handle request %s.%s on %r: %r",
+                        # failure.Failure() fishes the original Failure out
+                        # of our stack, and thus gives us a sensible stack
+                        # trace.
+                        f = failure.Failure()
+                        logger.error(
+                            "Failed handle request %s.%s on %r: %r: %s",
                             request_handler.__module__,
                             request_handler.__name__,
                             self,
-                            request
+                            request,
+                            f.getTraceback().rstrip(),
                         )
                         respond_with_json(
                             request,