|
1 | 1 | import { getProjectRoot } from '../../project-files' |
2 | 2 | import { useChatStore } from '../../state/chat-store' |
3 | 3 | import { processBashContext } from '../../utils/bash-context-processor' |
4 | | -import { getErrorObject } from '../../utils/error' |
5 | 4 | import { |
6 | 5 | createErrorMessage, |
7 | 6 | createPaymentErrorMessage, |
@@ -30,6 +29,7 @@ import type { StreamStatus } from '../use-message-queue' |
30 | 29 | import type { MessageContent, RunState } from '@codebuff/sdk' |
31 | 30 | import type { QueryClient } from '@tanstack/react-query' |
32 | 31 | import type { MutableRefObject, SetStateAction } from 'react' |
| 32 | +import { getErrorObject } from '@codebuff/common/util/error' |
33 | 33 |
|
34 | 34 | const yieldToEventLoop = () => |
35 | 35 | new Promise<void>((resolve) => { |
@@ -227,7 +227,7 @@ export const handleRunCompletion = (params: { |
227 | 227 | } |
228 | 228 | } else { |
229 | 229 | const partial = createErrorMessage( |
230 | | - 'Output error: ' + (output.message ?? 'No output from agent run'), |
| 230 | + output.message ?? 'No output from agent run', |
231 | 231 | aiMessageId, |
232 | 232 | ) |
233 | 233 | updater.setError(partial.content ?? '') |
@@ -292,7 +292,10 @@ export const handleRunError = (params: { |
292 | 292 |
|
293 | 293 | const partial = createErrorMessage(error, aiMessageId) |
294 | 294 |
|
295 | | - logger.error({ error: getErrorObject(error) }, 'SDK client.run() failed') |
| 295 | + logger.error( |
| 296 | + { error: getErrorObject(error, { includeRawError: true }) }, |
| 297 | + 'SDK client.run() failed', |
| 298 | + ) |
296 | 299 | setIsRetrying(false) |
297 | 300 | setStreamStatus('idle') |
298 | 301 | setCanProcessQueue(true) |
|
0 commit comments