Sha256: 6ad2a5867301c190fccacc0a2bf7d7c40a3e85e7ce9ca29e8591c2b5bd598bb5
Contents?: true
Size: 611 Bytes
Versions: 26
Compression:
Stored size: 611 Bytes
Contents
'use strict'; Object.defineProperty(exports, '__esModule', { value: true, }); exports.toError = toError; var _inspect = require('./inspect.js'); /** * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. */ function toError(thrownValue) { return thrownValue instanceof Error ? thrownValue : new NonErrorThrown(thrownValue); } class NonErrorThrown extends Error { constructor(thrownValue) { super('Unexpected error value: ' + (0, _inspect.inspect)(thrownValue)); this.name = 'NonErrorThrown'; this.thrownValue = thrownValue; } }
Version data entries
26 entries across 26 versions & 1 rubygems