mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
Updates error handling in case of incorrect tool calling. (#2304)
This commit is contained in:
parent
150df382f8
commit
db115c468a
2 changed files with 71 additions and 1 deletions
|
|
@ -110,10 +110,15 @@ export async function runNonInteractive(
|
|||
);
|
||||
|
||||
if (toolResponse.error) {
|
||||
const isToolNotFound = toolResponse.error.message.includes(
|
||||
'not found in registry',
|
||||
);
|
||||
console.error(
|
||||
`Error executing tool ${fc.name}: ${toolResponse.resultDisplay || toolResponse.error.message}`,
|
||||
);
|
||||
process.exit(1);
|
||||
if (!isToolNotFound) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (toolResponse.responseParts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue