File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/agent-runtime/src/llm-api Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,15 @@ export function createCodebuffApiClient(
393393 continue
394394 }
395395
396- // Don't retry, throw the error
396+ // Don't retry, throw the error with URL context
397+ if ( error instanceof Error ) {
398+ const enhancedError = new Error (
399+ `${ error . message } (${ method } ${ url } )` ,
400+ )
401+ enhancedError . name = error . name
402+ enhancedError . cause = error
403+ throw enhancedError
404+ }
397405 throw error
398406 }
399407 }
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ const callCodebuffV1 = async (params: {
6868 body : JSON . stringify ( payload ) ,
6969 } ) ,
7070 FETCH_TIMEOUT_MS ,
71+ `Request to ${ endpoint } timed out after ${ FETCH_TIMEOUT_MS } ms` ,
7172 )
7273
7374 const text = await res . text ( )
@@ -259,6 +260,7 @@ export async function callTokenCountAPI(params: {
259260 body : JSON . stringify ( payload ) ,
260261 } ) ,
261262 FETCH_TIMEOUT_MS ,
263+ `Request to /api/v1/token-count timed out after ${ FETCH_TIMEOUT_MS } ms` ,
262264 )
263265
264266 const text = await res . text ( )
You can’t perform that action at this time.
0 commit comments