UNPKG

@libp2p/interfaces

Version:
27 lines 778 B
/** * When this error is thrown it means an operation was aborted, * usually in response to the `abort` event being emitted by an * AbortSignal. */ export class AbortError extends Error { code; type; constructor(message = 'The operation was aborted') { super(message); this.code = AbortError.code; this.type = AbortError.type; } static code = 'ABORT_ERR'; static type = 'aborted'; } export class CodeError extends Error { code; props; constructor(message, code, props) { super(message); this.code = code; this.name = props?.name ?? 'CodeError'; this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions } } //# sourceMappingURL=errors.js.map