(err: Error, commandName: string, shouldSerialize = false)
| 94 | } |
| 95 | |
| 96 | export function handleErrorAndExit(err: Error, commandName: string, shouldSerialize = false) { |
| 97 | loader.off(); |
| 98 | logger.error(`got an error from command ${commandName}: ${err}`); |
| 99 | logger.error(err.stack || '<no error stack was found>'); |
| 100 | const { message, error } = defaultHandleError(err); |
| 101 | if (shouldSerialize) return serializeErrAndExit(error, commandName); |
| 102 | return logErrAndExit(message, commandName); |
| 103 | } |
| 104 | |
| 105 | export function handleUnhandledRejection(err: Error | null | undefined | {}) { |
| 106 | // eslint-disable-next-line no-console |
no test coverage detected