Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(errors): set this.name on three ComposioError subclasses
ComposioToolVersionRequiredError, JsonSchemaToZodError, and JsonSchemaRefResolutionError omitted the this.name assignment their sibling subclasses perform, so instances inherited the base class field value and reported name 'ComposioError'. error.name is forwarded to error telemetry, which mis-grouped these three distinct error types under the base name.
Rohit committed
Aug 13, 2026 at 14:19 UTC
c0f16093ed46153a95802c1eb30e83a165b9d05a
4 files changed
+40
.changeset/fix-error-subclass-names.md
new
+5
@@ -0,0 +1,5 @@
1
+---
2
+'@composio/core': patch
3
+---
4
+
5
+Fix three ComposioError subclasses (ComposioToolVersionRequiredError, JsonSchemaToZodError, JsonSchemaRefResolutionError) that omitted their `this.name` assignment and therefore reported `name` as 'ComposioError' instead of their own class name, mis-grouping distinct error types in error telemetry.
ts/packages/core/src/errors/ToolErrors.ts
+1
@@ -204,6 +204,7 @@ export class ComposioToolVersionRequiredError extends ComposioError {
204
'Set dangerouslySkipVersionCheck to true (this might cause unexpected behavior when new versions of the tools are released)',
205
],
206
});
207
+ this.name = 'ComposioToolVersionRequiredError';
208
}
209
}
210
export interface ComposioAPIServerErrorBody {
ts/packages/core/src/errors/ValidationErrors.ts
+2
@@ -78,6 +78,7 @@ export class JsonSchemaToZodError extends ComposioError {
78
...options,
79
code: options.code || ValidationErrorCodes.JSON_SCHEMA_TO_ZOD_ERROR,
80
});
81
+ this.name = 'JsonSchemaToZodError';
82
}
83
}
84
@@ -95,5 +96,6 @@ export class JsonSchemaRefResolutionError extends ComposioError {
96
...options,
97
code: options.code || ValidationErrorCodes.JSON_SCHEMA_REF_RESOLUTION_ERROR,
98
});
99
+ this.name = 'JsonSchemaRefResolutionError';
100
}
101
}
ts/packages/core/test/errors/errorNames.test.ts
new
+32
@@ -0,0 +1,32 @@
1
+import { describe, it, expect } from 'vitest';
2
+import { ComposioError } from '../../src/errors/ComposioError';
3
+import { ComposioToolVersionRequiredError } from '../../src/errors/ToolErrors';
4
+import {
5
+ JsonSchemaToZodError,
6
+ JsonSchemaRefResolutionError,
7
+} from '../../src/errors/ValidationErrors';
8
+
9
+// The base ComposioError assigns `name` as a class field, so a subclass that does
10
+// not reassign `this.name` in its constructor inherits the base value and reports
11
+// 'ComposioError'. error.name is forwarded to error telemetry (see Telemetry.ts),
12
+// where that silently mis-groups distinct error types under the base name. These
13
+// three subclasses had omitted the reassignment their ~30 siblings all perform.
14
+describe('ComposioError subclass names', () => {
15
+ it('ComposioToolVersionRequiredError reports its own name', () => {
16
+ const error = new ComposioToolVersionRequiredError();
17
+ expect(error).toBeInstanceOf(ComposioError);
18
+ expect(error.name).toBe('ComposioToolVersionRequiredError');
19
+ });
20
+
21
+ it('JsonSchemaToZodError reports its own name', () => {
22
+ const error = new JsonSchemaToZodError();
23
+ expect(error).toBeInstanceOf(ComposioError);
24
+ expect(error.name).toBe('JsonSchemaToZodError');
25
+ });
26
+
27
+ it('JsonSchemaRefResolutionError reports its own name', () => {
28
+ const error = new JsonSchemaRefResolutionError();
29
+ expect(error).toBeInstanceOf(ComposioError);
30
+ expect(error.name).toBe('JsonSchemaRefResolutionError');
31
+ });
32
+});