mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 04:26:58 +00:00
use uncaughtExceptionMonitor instead uncaughtException
This commit is contained in:
parent
20370e5e75
commit
0a56ce92ca
5 changed files with 8 additions and 8 deletions
|
@ -64,13 +64,13 @@ async function main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display detail of uncaught exception
|
// Display detail of uncaught exception
|
||||||
process.on('uncaughtException', err => {
|
process.on('uncaughtExceptionMonitor', ((err, origin) => {
|
||||||
try {
|
try {
|
||||||
logger.error('Uncaught exception:', err);
|
logger.error(`Uncaught exception (${origin}):`, err);
|
||||||
} catch {
|
} catch {
|
||||||
console.error('Uncaught exception:', err);
|
console.error(`Uncaught exception (${origin}):`, err);
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
|
|
||||||
// Dying away...
|
// Dying away...
|
||||||
process.on('exit', code => {
|
process.on('exit', code => {
|
||||||
|
|
|
@ -101,7 +101,7 @@ async function watchSrc() {
|
||||||
process.on('SIGHUP', resolve);
|
process.on('SIGHUP', resolve);
|
||||||
process.on('SIGINT', resolve);
|
process.on('SIGINT', resolve);
|
||||||
process.on('SIGTERM', resolve);
|
process.on('SIGTERM', resolve);
|
||||||
process.on('uncaughtException', reject);
|
process.on('uncaughtExceptionMonitor', reject);
|
||||||
process.on('exit', resolve);
|
process.on('exit', resolve);
|
||||||
}).finally(async () => {
|
}).finally(async () => {
|
||||||
await context.dispose();
|
await context.dispose();
|
||||||
|
|
|
@ -99,7 +99,7 @@ async function watchSrc() {
|
||||||
process.on('SIGHUP', resolve);
|
process.on('SIGHUP', resolve);
|
||||||
process.on('SIGINT', resolve);
|
process.on('SIGINT', resolve);
|
||||||
process.on('SIGTERM', resolve);
|
process.on('SIGTERM', resolve);
|
||||||
process.on('uncaughtException', reject);
|
process.on('uncaughtExceptionMonitor', reject);
|
||||||
process.on('exit', resolve);
|
process.on('exit', resolve);
|
||||||
}).finally(async () => {
|
}).finally(async () => {
|
||||||
await context.dispose();
|
await context.dispose();
|
||||||
|
|
|
@ -100,7 +100,7 @@ async function watchSrc() {
|
||||||
process.on('SIGHUP', resolve);
|
process.on('SIGHUP', resolve);
|
||||||
process.on('SIGINT', resolve);
|
process.on('SIGINT', resolve);
|
||||||
process.on('SIGTERM', resolve);
|
process.on('SIGTERM', resolve);
|
||||||
process.on('uncaughtException', reject);
|
process.on('uncaughtExceptionMonitor', reject);
|
||||||
process.on('exit', resolve);
|
process.on('exit', resolve);
|
||||||
}).finally(async () => {
|
}).finally(async () => {
|
||||||
await context.dispose();
|
await context.dispose();
|
||||||
|
|
|
@ -99,7 +99,7 @@ async function watchSrc() {
|
||||||
process.on('SIGHUP', resolve);
|
process.on('SIGHUP', resolve);
|
||||||
process.on('SIGINT', resolve);
|
process.on('SIGINT', resolve);
|
||||||
process.on('SIGTERM', resolve);
|
process.on('SIGTERM', resolve);
|
||||||
process.on('uncaughtException', reject);
|
process.on('uncaughtExceptionMonitor', reject);
|
||||||
process.on('exit', resolve);
|
process.on('exit', resolve);
|
||||||
}).finally(async () => {
|
}).finally(async () => {
|
||||||
await context.dispose();
|
await context.dispose();
|
||||||
|
|
Loading…
Add table
Reference in a new issue