mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 01:30:37 +08:00
Handle error in a graceful way
This commit is contained in:
parent
7167be852f
commit
ef5df30203
@ -28,6 +28,15 @@ import { buildCloudMounterRules } from './build-cloudmounter-rules';
|
||||
import { createSpan, printTraceResult } from './trace';
|
||||
import { buildDeprecateFiles } from './build-deprecate-files';
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
console.error('Uncaught exception:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
process.on('unhandledRejection', (reason) => {
|
||||
console.error('Unhandled rejection:', reason);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
(async () => {
|
||||
const rootSpan = createSpan('root');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user