sdin
Version:
JavaScript package builder.
14 lines (11 loc) • 349 B
text/typescript
import { printError } from 'utils/print'
process.on('uncaughtException', error => {
printError('Uncaught exception.', error, -1)
})
process.on('unhandledRejection', reason => {
if (reason instanceof Error) {
printError('Unhandled rejection.', reason, -2)
} else {
printError(reason || 'Unhandled rejection.', -2)
}
})