Skip to content

Commit dc884b0

Browse files
committed
endpoints: Surface failed event errors in logs
I wasn't able to make out what was wrong while running LCS, as the unexpected error message wasn't much to go on with. Upon surfacing the actual error, I noticed that the failed event fired since I had hit my token limit, which I believe is useful enough information to be surfaced. I understand if this wasn't done earlier to prevent sensitive data leakage, in which case, I'll close this, or add a case to surface only when token limit is hit, although that may be tricky since different LLMs report that in different ways. Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
1 parent 76e13bf commit dc884b0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/app/endpoints/streaming_query_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ async def response_generator( # pylint: disable=too-many-branches,too-many-stat
266266
)
267267
error_response = InternalServerErrorResponse.query_failed(error_message)
268268
logger.error("Error while obtaining answer for user question")
269+
logger.debug("Full error response: %s", failed_chunk.response)
269270
yield format_stream_data(
270271
{"event": "error", "data": {**error_response.detail.model_dump()}}
271272
)

0 commit comments

Comments
 (0)