add dispatch try catch (#3075)

This commit is contained in:
heheer
2024-11-06 10:12:54 +08:00
committed by archer
parent 8303933ec2
commit 78ef74f902
3 changed files with 29 additions and 2 deletions

View File

@@ -525,6 +525,12 @@ const ChatBox = (
generatingMessage: (e) => generatingMessage({ ...e, autoTTSResponse }),
variables: requestVariables
});
if (responseData?.[responseData.length - 1]?.error) {
toast({
title: responseData[responseData.length - 1].error?.message,
status: 'error'
});
}
isNewChatReplace.current = isNewChat;

View File

@@ -235,6 +235,12 @@ const PluginRunContextProvider = ({
...variables
}
});
if (responseData?.[responseData.length - 1]?.error) {
toast({
title: responseData[responseData.length - 1].error?.message,
status: 'error'
});
}
setHistories((state) =>
state.map((item, index) => {