mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 07:53:48 +09:00
21 lines
574 B
TypeScript
21 lines
574 B
TypeScript
import { isProduction, isDebug } from 'std-env'
|
|
|
|
export function registerProcessHandlers() {
|
|
if (!isProduction || isDebug) {
|
|
process.on('unhandledRejection', error =>
|
|
console.error('[dev] [unhandledRejection]', error),
|
|
)
|
|
process.on('uncaughtException', error =>
|
|
console.error('[dev] [uncaughtException]', error),
|
|
)
|
|
}
|
|
else {
|
|
process.on('unhandledRejection', error =>
|
|
console.error('[unhandledRejection] ' + error),
|
|
)
|
|
process.on('uncaughtException', error =>
|
|
console.error('[uncaughtException] ' + error),
|
|
)
|
|
}
|
|
}
|