@devries-cameron20 / composio Mirror · read-only / commits / 82ca7384d
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 14:45 UTC

fix(errors): set this.name on three ComposioError subclasses (#4128)

## What `ComposioError` (`errors/ComposioError.ts`) assigns `name` as a class field (`public name = 'ComposioError'`). Under the package tsconfig (es2022 -> `useDefineForClassFields`), each subclass must reassign `this.name` in its constructor or it inherits the base value. ~30 sibling subclasses do this; three omitted it: - `ComposioToolVersionRequiredError` (`errors/ToolErrors.ts`) - `JsonSchemaToZodError` (`errors/ValidationErrors.ts`) - `JsonSchemaRefResolutionError` (`errors/ValidationErrors.ts`) So `new JsonSchemaToZodError().name === 'ComposioError'`, and the same for the other two. All three are thrown on real paths (`Tools.ts`, `jsonSchema.ts`), and `error.name` is forwarded to error telemetry (`telemetry/Telemetry.ts`), so these distinct error types silently mis-group under the base name; any consumer branching on `err.name === '<ClassName>'` never matches. ## Fix Add the missing `this.name = '<ClassName>'` at the end of each of the three constructors, matching the established sibling pattern. Runtime-only; no type or public-API change. (The two `PusherErrors` subclasses set `name` via a class field, which already resolves correctly, so they are intentionally left untouched.) ## Tests Adds `test/errors/errorNames.test.ts` asserting each of the three reports its own class name and is `instanceof ComposioError`. Verified fails-before / passes-after; full `@composio/core` suite green (1095 tests), plus `tsc`, oxlint, and prettier clean.

Alberto Schiabel committed Aug 27, 2026 at 19:17 UTC 82ca7384d54192fab5595ab217084c8c6df38273

No changes.