Skip to content

Commit a455e7c

Browse files
authored
feat: dont swallow application errors in streaming response [LET-4069] (#4253)
* feat: dont swallow application errors in streaming response * change error back to exception
1 parent 07dbd8b commit a455e7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

letta/server/rest_api/streaming_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ async def _protected_stream_response(self, send: Send) -> None:
296296
raise LettaUnexpectedStreamCancellationError("Stream was terminated due to unexpected cancellation from server")
297297

298298
except Exception as exc:
299-
logger.exception("Unhandled Streaming Error")
299+
logger.exception(f"Unhandled Streaming Error: {str(exc)}")
300300
more_body = False
301-
error_resp = {"error": {"message": "Internal Server Error"}}
301+
error_resp = {"error": {"message": str(exc)}}
302302
error_event = f"event: error\ndata: {json.dumps(error_resp)}\n\n".encode(self.charset)
303303
logger.debug("response_started:", self.response_started)
304304
if not self.response_started:

0 commit comments

Comments
 (0)