@metamask/kernel-errors
Version:
18 lines • 898 B
text/typescript
import type { Json } from "@metamask/utils";
import { ErrorCode } from "./constants.cjs";
import type { MarshaledOcapError, OcapError, ErrorOptionsWithStack, MarshaledError } from "./types.cjs";
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.cts.map