Handle error in a graceful way

This commit is contained in:
SukkaW 2024-06-03 13:42:58 +08:00
parent 7167be852f
commit ef5df30203

View File

@ -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');