Files
dmz/server/serve/process-handlers.ts
2025-05-24 01:47:40 +09:00

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),
)
}
}