Typed error class for all CBOR-related errors.
Wraps the discriminated union Error type in a JavaScript Error object for proper error handling with stack traces.
throw new CborError({ type: 'Underrun' });throw new CborError({ type: 'WrongTag', expected: tag1, actual: tag2 }); Copy
throw new CborError({ type: 'Underrun' });throw new CborError({ type: 'WrongTag', expected: tag1, actual: tag2 });
Create a new CborError.
The discriminated union error type
Optional
Optional custom message (defaults to errorToString(errorType))
Readonly
The structured error information.
Static
Check if an error is a CborError.
Error to check
True if error is a CborError
Typed error class for all CBOR-related errors.
Wraps the discriminated union Error type in a JavaScript Error object for proper error handling with stack traces.
Example