UNPKG

@metamask/kernel-errors

Version:
18 lines 898 B
import type { Json } from "@metamask/utils"; import { ErrorCode } from "./constants.mjs"; import type { MarshaledOcapError, OcapError, ErrorOptionsWithStack, MarshaledError } from "./types.mjs"; export declare class BaseError extends Error implements OcapError { readonly code: ErrorCode; readonly data: Json | undefined; constructor(code: ErrorCode, message: string, options?: ErrorOptionsWithStack & { data?: Json; }); /** * A placeholder for unmarshal functionality. Should be implemented in subclasses. * * @param _marshaledError - The marshaled error to unmarshal. * @param _unmarshalErrorOptions - A function to unmarshal the error options. */ static unmarshal(_marshaledError: MarshaledOcapError, _unmarshalErrorOptions: (marshaledError: MarshaledError) => ErrorOptionsWithStack): BaseError; } //# sourceMappingURL=BaseError.d.mts.map