Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2705 from matrix-org/rav/improve_tracebacks
Browse files Browse the repository at this point in the history
Improve tracebacks on exceptions
  • Loading branch information
richvdh authored Nov 27, 2017
2 parents 79eba87 + 6be01f5 commit 96387bd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)

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
Expand Down Expand Up @@ -131,12 +132,17 @@ def wrapped_request_handler(self, request):
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,
Expand Down

0 comments on commit 96387bd

Please sign in to comment.