From: Jérôme Benoit Date: Sat, 29 Jul 2023 17:24:07 +0000 (+0200) Subject: refactor: switch to try catch construct X-Git-Tag: v1.2.20~95 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9fe88c42d40c7931b0e9c7990633c658758b39ba;p=e-mobility-charging-stations-simulator.git refactor: switch to try catch construct Signed-off-by: Jérôme Benoit --- diff --git a/src/start.ts b/src/start.ts index 12acc3eb..af569c53 100644 --- a/src/start.ts +++ b/src/start.ts @@ -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); +}