UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

1 lines 1.26 kB
{"version":3,"file":"track-error.cjs","sourceRoot":"","sources":["../../../src/types/methods/track-error.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * An error that can be tracked by the `snap_trackError` method.\n */\nexport type TrackableError = {\n /**\n * The name of the error. This is typically the constructor name of the\n * error, such as `TypeError`, `ReferenceError`, or a custom error name.\n */\n name: string;\n\n /**\n * The error message.\n */\n message: string;\n\n /**\n * The error stack, if available. If the error does not have a stack, this\n * will be `null`.\n */\n stack: string | null;\n\n /**\n * The cause of the error, if available. This can be another error object or\n * `null` if there is no cause.\n */\n cause: TrackableError | null;\n};\n\n/**\n * The parameters for the `snap_trackError` method.\n *\n * Note that this method is only available to preinstalled Snaps.\n */\nexport type TrackErrorParams = {\n /**\n * The error object to track.\n */\n error: TrackableError;\n};\n\n/**\n * The result returned by the `snap_trackEvent` method. This is the ID of the\n * tracked error, as returned by the Sentry instance in the client.\n */\nexport type TrackErrorResult = string;\n"]}