This commit is contained in:
2025-05-24 01:47:40 +09:00
commit 09d97cbb0b
1594 changed files with 184634 additions and 0 deletions

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