UNPKG

@metamask/kernel-errors

Version:
15 lines 468 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toError = toError; /** * Coerce an unknown problem into an Error object. * * @param problem - Whatever was caught. * @returns The problem if it is an Error, or a new Error with the problem as the cause. */ function toError(problem) { return problem instanceof Error ? problem : new Error('Unknown', { cause: problem }); } //# sourceMappingURL=toError.cjs.map