Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle HTTP errors when sending steps #1248

Merged

Conversation

oshoma
Copy link
Contributor

@oshoma oshoma commented Aug 20, 2024

Fixes #1232

Modify Chainlit so that HTTP errors which occur while sending steps to LiteralAI are caught and logged.

Prior to this change, HTTP errors such as timeouts result in a series of cascading exceptions and tracebacks that begin with "Task exception was never retrieved" and continue for several traceback iterations. The result is a very verbose log which is hard to understand and debug.

After this change we will see one-line error messages in the log when HTTP errors occur, rather than a series of tracebacks.

In the future we might want to improve this further by retrying (sending the steps again) when the HTTP error is temporary.

Fixes Chainlit#1232

Modify Chainlit so that HTTP errors which occur while sending steps
to LiteralAI are caught and logged.

Prior to this change, HTTP errors such as timeouts result in a series
of cascading exceptions and tracebacks that begin with "Task exception
was never retrieved" and continue for several traceback iterations.
The result is a very verbose log which is hard to understand.

With this change we will see one-line error messages in the log
rather than a series of tracebacks.

In the future we might want to improve this further by retrying
(sending the steps again) when the HTTP error is temporary.
@dokterbob
Copy link
Collaborator

@willydouhard This will capture HTTP errors with retry logic for all data layer backends. Appreciate your quick review on this.

Should you not have time, I'll merge this within 7 days as it seems safe enough for now.

@dokterbob dokterbob added the backend Pertains to the Python backend. label Aug 22, 2024
@dokterbob dokterbob merged commit ce9c992 into Chainlit:main Aug 22, 2024
4 checks passed
@oshoma
Copy link
Contributor Author

oshoma commented Aug 22, 2024

Thank you @dokterbob and @willydouhard, much appreciated.

@oshoma oshoma deleted the handle-http-errors-gracefully-fixes-1232 branch October 1, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Pertains to the Python backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Task exception was never retrieved" in ChainlitDataLayer.update_step()
3 participants