From 9fe88c42d40c7931b0e9c7990633c658758b39ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 29 Jul 2023 19:24:07 +0200 Subject: [PATCH] refactor: switch to try catch construct MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/start.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); +} -- 2.34.1