diff --git a/index.ts b/index.ts index 6ce4dab8d95e63ecc7715458e477e4f8e5f0e42e..e7e6a32e0194faf11b4035e741684784b0921f66 100644 --- a/index.ts +++ b/index.ts @@ -30,6 +30,12 @@ const pluginDependency = require('./app/modules/plugin'); let sigintListening = false +// Trace errors +process.on('unhandledRejection', (reason) => { + logger.error('Unhandled rejection: ' + reason); + logger.error(reason); +}); + class Stacks { static todoOnRunDone:() => any = () => process.exit() @@ -441,12 +447,6 @@ class Stack { executeStack(argv:string[]) { - // Trace these errors - process.on('unhandledRejection', (reason) => { - logger.error('Unhandled rejection: ' + reason); - logger.error(reason); - }); - // Executes the command return this.cli.execute(argv); }