refactor: switch to try catch construct
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 29 Jul 2023 17:24:07 +0000 (19:24 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 29 Jul 2023 17:24:07 +0000 (19:24 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/start.ts

index 12acc3eb1477a1d0901deef7d90edda54795ec40..af569c53e3e46f2e12c694c221b6e1620955111c 100644 (file)
@@ -4,8 +4,8 @@ import chalk from 'chalk';
 
 import { Bootstrap } from './charging-station';
 
-Bootstrap.getInstance()
-  .start()
-  .catch((error) => {
-    console.error(chalk.red('Startup error: '), error);
-  });
+try {
+  await Bootstrap.getInstance().start();
+} catch (error) {
+  console.error(chalk.red('Startup error: '), error);
+}