It converts any throwable into an Error.
- node: 18
Through NPM as @chubbyts/chubbyts-throwable-to-error.
npm i @chubbyts/chubbyts-throwable-to-error@^1.3.2
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