fix: use correct error handling for chat messages and ingestion #859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive improvements to error handling and error message display across the chat frontend and backend. The main changes include a new, user-friendly error message component in the UI, consistent propagation and storage of error states in chat messages, and enhanced error detection and reporting throughout the backend and API layers. These updates result in clearer feedback for users when errors occur and ensure that error messages persist and are properly displayed in chat history.
Frontend Enhancements:
Error Message UI:
ErrorMessageReact component for displaying styled error messages in chat, including support for animation and custom icons.ChatPageto renderErrorMessageinstead of the standard assistant message when a message has anerrorflag. [1] [2]errorproperty to the chat message type and ensured it is set and propagated when errors occur during chat interactions or streaming. [1] [2] [3] [4] [5] [6]Streaming and Error Propagation:
useChatStreaming) to detect error states from the backend, propagate them via theerrorflag, and ensure error messages are immediately added to chat history and persist on refresh. [1] [2] [3] [4] [5] [6]Backend and API Improvements:
Error Detection and Storage:
errorflag in messages, and store these error messages in the conversation history for persistence. [1] [2] [3] [4] [5]Error Message Extraction and Reporting:
These changes collectively provide a more robust and user-friendly experience when errors occur, ensuring that error states are clearly communicated, persist in chat history, and are handled consistently throughout the application.
Closes #810
Needs langflow-ai/langflow#11467