fix(gateway): throw error when run from cli (#2627)

* fix: throw error when run from cli

* chore: log error
This commit is contained in:
ChengLei Shao 2023-09-11 15:45:30 +08:00 committed by GitHub
parent 6cc88dfa2b
commit b9abbd5cbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,7 +215,15 @@ export class Gateway extends EventEmitter {
}
const mainApp = AppSupervisor.getInstance().bootMainApp(options.mainAppOptions);
mainApp.runAsCLI();
mainApp
.runAsCLI(process.argv, {
throwError: true,
from: 'node',
})
.catch((e) => {
console.error(e);
});
}
isStart() {