mirror of
https://git.hmsn.ink/kospo/svcm/dmz.git
synced 2026-03-20 05:43:33 +09:00
first
This commit is contained in:
20
server/serve/process-handlers.ts
Normal file
20
server/serve/process-handlers.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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),
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user