mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +00:00
Fix javascript-repl to throw errors on execution failure
- Throw error instead of returning output when result.success is false - Ensures tool call is marked as failed when code execution fails or is aborted - Matches browser-javascript error handling pattern
This commit is contained in:
parent
4ac774cbbb
commit
c0ad46fa01
1 changed files with 2 additions and 3 deletions
|
|
@ -59,9 +59,8 @@ export async function executeJavaScript(
|
||||||
if (output) output += "\n";
|
if (output) output += "\n";
|
||||||
output += `Error: ${result.error?.message || "Unknown error"}\n${result.error?.stack || ""}`;
|
output += `Error: ${result.error?.message || "Unknown error"}\n${result.error?.stack || ""}`;
|
||||||
|
|
||||||
return {
|
// Throw error so tool call is marked as failed
|
||||||
output: output.trim(),
|
throw new Error(output.trim());
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add return value if present
|
// Add return value if present
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue