It converts any throwable into an Error.
npm install @chubbyts/chubbyts-throwable-to-error














It converts any throwable into an Error.
* node: 18
Through NPM as [@chubbyts/chubbyts-throwable-to-error][1].
``ts`
npm i @chubbyts/chubbyts-throwable-to-error@^2.0.2
`ts
import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
try {
throw {key: 'value'};
} catch (e) {
const error = throwableToError(e);
}
``
2025 Dominik Zogg
[1]: https://www.npmjs.com/package/@chubbyts/chubbyts-throwable-to-error