mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
adds server and client error handling, clear convos in progress
This commit is contained in:
parent
511ac948b4
commit
51d93da3f8
9 changed files with 98 additions and 48 deletions
|
|
@ -35,8 +35,20 @@ export default function TextChat({ messages, reloadConvos }) {
|
|||
reloadConvos();
|
||||
dispatch(setSubmitState(false));
|
||||
};
|
||||
|
||||
const errorHandler = (data) => {
|
||||
console.log('Error:', data);
|
||||
const errorResponse = {
|
||||
...initialResponse,
|
||||
text: 'An error occurred. Please try again in a few moments.',
|
||||
error: true
|
||||
};
|
||||
dispatch(setSubmitState(false));
|
||||
dispatch(setMessages([...messages, currentMsg, errorResponse]));
|
||||
return;
|
||||
};
|
||||
console.log('User Input:', payload);
|
||||
handleSubmit(payload, messageHandler, convo, convoHandler);
|
||||
handleSubmit({ text: payload, messageHandler, convo, convoHandler, errorHandler });
|
||||
};
|
||||
|
||||
const handleKeyPress = (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue