fix: show actual error details in chat error messages
- Extract error from err.response.data.error (axios error response) - Log full error to console for debugging - Show actual backend error message instead of generic 'Error'
This commit is contained in:
@@ -669,10 +669,12 @@ const sendMessage = async () => {
|
|||||||
await sendToAgent(message)
|
await sendToAgent(message)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
addLog(t('log.sendFailed', { error: err.message }))
|
const errDetail = err.response?.data?.error || err.message || 'Unknown error'
|
||||||
|
console.error('Chat error:', err)
|
||||||
|
addLog(`❌ ${t('log.sendFailed', { error: errDetail })}`)
|
||||||
chatHistory.value.push({
|
chatHistory.value.push({
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
content: t('step5.errorOccurred', { error: err.message }),
|
content: `❌ ${t('step5.errorOccurred', { error: errDetail })}`,
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user