mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 10:23:53 +01:00
Merge pull request #4737 from matrix-org/erikj/failure_log_tb
Log tracebacks correctly
This commit is contained in:
commit
65f3fbfbf7
5 changed files with 14 additions and 8 deletions
|
@ -1 +1 @@
|
||||||
Cleanup request exception logging
|
Cleanup request exception logging.
|
||||||
|
|
1
changelog.d/4737.misc
Normal file
1
changelog.d/4737.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Cleanup request exception logging.
|
|
@ -240,8 +240,9 @@ class FederationServer(FederationBase):
|
||||||
f = failure.Failure()
|
f = failure.Failure()
|
||||||
pdu_results[event_id] = {"error": str(e)}
|
pdu_results[event_id] = {"error": str(e)}
|
||||||
logger.error(
|
logger.error(
|
||||||
"Failed to handle PDU %s: %s",
|
"Failed to handle PDU %s",
|
||||||
event_id, f.getTraceback().rstrip(),
|
event_id,
|
||||||
|
exc_info=(f.type, f.value, f.getTracebackObject()),
|
||||||
)
|
)
|
||||||
|
|
||||||
yield concurrently_execute(
|
yield concurrently_execute(
|
||||||
|
|
|
@ -136,7 +136,11 @@ class PaginationHandler(object):
|
||||||
logger.info("[purge] complete")
|
logger.info("[purge] complete")
|
||||||
self._purges_by_id[purge_id].status = PurgeStatus.STATUS_COMPLETE
|
self._purges_by_id[purge_id].status = PurgeStatus.STATUS_COMPLETE
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error("[purge] failed: %s", Failure().getTraceback().rstrip())
|
f = Failure()
|
||||||
|
logger.error(
|
||||||
|
"[purge] failed",
|
||||||
|
exc_info=(f.type, f.value, f.getTracebackObject()),
|
||||||
|
)
|
||||||
self._purges_by_id[purge_id].status = PurgeStatus.STATUS_FAILED
|
self._purges_by_id[purge_id].status = PurgeStatus.STATUS_FAILED
|
||||||
finally:
|
finally:
|
||||||
self._purges_in_progress_by_room.discard(room_id)
|
self._purges_in_progress_by_room.discard(room_id)
|
||||||
|
|
|
@ -169,18 +169,18 @@ def _return_html_error(f, request):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.error(
|
logger.error(
|
||||||
"Failed handle request %r: %s",
|
"Failed handle request %r",
|
||||||
request,
|
request,
|
||||||
f.getTraceback().rstrip(),
|
exc_info=(f.type, f.value, f.getTracebackObject()),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
code = http_client.INTERNAL_SERVER_ERROR
|
code = http_client.INTERNAL_SERVER_ERROR
|
||||||
msg = "Internal server error"
|
msg = "Internal server error"
|
||||||
|
|
||||||
logger.error(
|
logger.error(
|
||||||
"Failed handle request %r: %s",
|
"Failed handle request %r",
|
||||||
request,
|
request,
|
||||||
f.getTraceback().rstrip(),
|
exc_info=(f.type, f.value, f.getTracebackObject()),
|
||||||
)
|
)
|
||||||
|
|
||||||
body = HTML_ERROR_TEMPLATE.format(
|
body = HTML_ERROR_TEMPLATE.format(
|
||||||
|
|
Loading…
Reference in a new issue