We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bff5c65 commit fd5b1f7Copy full SHA for fd5b1f7
1 file changed
src/main.ts
@@ -149,22 +149,20 @@ function registerTool(tool: ToolDefinition): void {
149
};
150
} catch (error) {
151
logger(`${tool.name} response handling error:`, error, error.stack);
152
- const errorText =
153
- error instanceof Error ? error.message : String(error);
154
-
155
- return {
156
- content: [
157
- {
158
- type: 'text',
159
- text: errorText,
160
- },
161
- ],
162
- isError: true,
163
- };
+ throw error;
164
}
165
} catch (err) {
166
logger(`${tool.name} error:`, err, err.stack);
167
- throw err;
+ const errorText = 'message' in err ? err.message : String(err);
+ return {
+ content: [
+ {
+ type: 'text',
+ text: errorText,
+ },
+ ],
+ isError: true,
+ };
168
} finally {
169
guard.dispose();
170
0 commit comments