UNPKG

@metamask/kernel-errors

Version:
1 lines 698 B
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { ErrorCode, ErrorSentinel } from './constants.ts';\n\nexport type ErrorOptionsWithStack = ErrorOptions & {\n stack?: string;\n};\n\nexport type OcapError = {\n code: ErrorCode;\n data: Json | undefined;\n} & Error;\n\nexport type MarshaledError = {\n [ErrorSentinel]: true;\n message: string;\n code?: ErrorCode;\n data?: Json;\n stack?: string;\n cause?: MarshaledError | string;\n};\n\nexport type MarshaledOcapError = Omit<MarshaledError, 'code' | 'data'> & {\n code: ErrorCode;\n data: Json;\n};\n"]}