fix: enhance error logging for malformed request in stream route

This commit is contained in:
Alex
2025-08-04 11:41:41 +01:00
parent 762ea6ce7f
commit 4caff0fcf6

View File

@@ -94,9 +94,12 @@ class StreamResource(Resource, BaseAnswerResource):
),
mimetype="text/event-stream",
)
except ValueError:
except ValueError as e:
message = "Malformed request body"
logger.error(f"/stream - error: {message}")
logger.error(
f"/stream - error: {message} - specific error: {str(e)} - traceback: {traceback.format_exc()}",
extra={"error": str(e), "traceback": traceback.format_exc()},
)
return Response(
self.error_stream_generate(message),
status=400,