Skip to content

Commit 708d3b4

Browse files
fix: set tool.error span attribute in catch block
The catch path was returning isError: true without marking the span, causing validation failures and unexpected exceptions to appear as successful spans in tracing backends. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1052b1e commit 708d3b4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/tools/BaseTool.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export abstract class BaseTool<
5050
}
5151
return result;
5252
} catch (error) {
53+
span.setAttribute('tool.error', true);
5354
return {
5455
isError: true,
5556
content: [{ type: 'text', text: (error as Error).message }]

0 commit comments

Comments
 (0)