MCPcopy Create free account
hub / github.com/ShipSecAI/studio / getErrorType

Function getErrorType

packages/component-sdk/src/errors.ts:503–511  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

501 * Get error type name for classification
502 */
503export function getErrorType(error: unknown): string {
504 if (isComponentError(error)) {
505 return error.type;
506 }
507 if (error instanceof Error) {
508 return error.name;
509 }
510 return 'UnknownError';
511}
512
513/**
514 * Wrap an unknown error in the appropriate ComponentError type.

Callers 1

errors.test.tsFile · 0.90

Calls 1

isComponentErrorFunction · 0.85

Tested by

no test coverage detected