mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30: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
|
|
@ -1,6 +1,12 @@
|
|||
import { SSE } from '../../app/sse';
|
||||
|
||||
export default function handleSubmit(text, messageHandler, convo, convoHandler) {
|
||||
export default function handleSubmit({
|
||||
text,
|
||||
convo,
|
||||
messageHandler,
|
||||
convoHandler,
|
||||
errorHandler
|
||||
}) {
|
||||
let payload = { text };
|
||||
if (convo.conversationId && convo.parentMessageId) {
|
||||
payload = {
|
||||
|
|
@ -34,7 +40,8 @@ export default function handleSubmit(text, messageHandler, convo, convoHandler)
|
|||
events.onerror = function (e) {
|
||||
console.log(e, 'error in opening conn.');
|
||||
events.close();
|
||||
errorHandler(e);
|
||||
};
|
||||
|
||||
events.stream();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue