From 4959be739a3823fc3685957b1d5f567751741378 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Thu, 29 Apr 2021 16:22:01 +0200 Subject: [PATCH] Handle config initialisation error on app bootstrap Signed-off-by: David Mehren --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 589b01696..d2b75f3a9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,6 +26,11 @@ async function bootstrap(): Promise { const appConfig = configService.get('appConfig'); const mediaConfig = configService.get('mediaConfig'); + if (!appConfig || !mediaConfig) { + logger.error('Could not initialize config, aborting.', 'AppBootstrap'); + process.exit(1); + } + setupPublicApiDocs(app); logger.log( `Serving OpenAPI docs for public api under '/apidoc'`,