summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r--synapse/http/server.py6
1 files changed, 5 insertions, 1 deletions
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)