Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Update error handling in useChatActions hook to provide more informative error messages

Salman-Ahamed1926a6026254
diff --git a/packages/app/src/react/features/ai-chat/hooks/use-chat-actions.ts b/packages/app/src/react/features/ai-chat/hooks/use-chat-actions.ts
index 8410c6ad..d742c06a 100644
--- a/packages/app/src/react/features/ai-chat/hooks/use-chat-actions.ts
+++ b/packages/app/src/react/features/ai-chat/hooks/use-chat-actions.ts
@@ -406,7 +406,7 @@ export const useChatActions = ({
const lastMessage = newMessages[newMessages.length - 1];
if (lastMessage) {
lastMessage.isReplying = false;
- lastMessage.message = CHAT_ERROR_MESSAGE;
+ lastMessage.message = error.error || error.message || CHAT_ERROR_MESSAGE;
lastMessage.isError = true;
}
return newMessages;