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:
Waleed Latif
2026-04-09 15:52:57 -07:00
parent f68f233c44
commit 8d678c27f5

View File

@@ -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)
}