From 20fc57683cd178711c44fe90f2355b653013c00a Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 20 Jan 2022 17:04:54 +0000 Subject: log exceptions in _async_write_json_to_request_in_thread --- synapse/http/server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synapse/http/server.py b/synapse/http/server.py index 09b4125489..42eba19b54 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -776,7 +776,11 @@ async def _async_write_json_to_request_in_thread( with start_active_span("encode_json_response"): span = active_span() - json_str = await defer_to_thread(request.reactor, encode, span) + try: + json_str = await defer_to_thread(request.reactor, encode, span) + except Exception: + logger.exception("failed to encode json response") + return _write_bytes_to_request(request, json_str) -- cgit 1.4.1