mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(tools): pass errorExtractor to extractErrorMessage and handle proxy error format
The executor was calling extractErrorMessage without the tool's errorExtractor
ID, so the tool-specific extractor was never used. Also add fallback for the
internal proxy route error format ({ error: "..." }) which none of the
Atlassian-specific patterns matched.
This commit is contained in:
@@ -61,11 +61,14 @@ export async function executeRequest(
|
||||
}
|
||||
}
|
||||
|
||||
const error = extractErrorMessage({
|
||||
status: resolvedResponse.status,
|
||||
statusText: resolvedResponse.statusText,
|
||||
data: errorData,
|
||||
})
|
||||
const error = extractErrorMessage(
|
||||
{
|
||||
status: resolvedResponse.status,
|
||||
statusText: resolvedResponse.statusText,
|
||||
data: errorData,
|
||||
},
|
||||
tool.errorExtractor
|
||||
)
|
||||
logger.error(`${toolId} error:`, { error })
|
||||
throw new Error(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user