diff --git a/libs/server/config.ts b/libs/server/config.ts index 89d1a4d3a..c631bf3a5 100644 --- a/libs/server/config.ts +++ b/libs/server/config.ts @@ -59,6 +59,7 @@ enum ErrTitle { CONFIG_FILE_READ_FAIL = 'Failed to load configuration file', INVALID_AUTH_CONFIG = 'Invalid authorisation configuration', CONFIG_FILE_PARSE_FAIL = 'Could not parse configuration file', + INVALID_STORE_CONFIG = 'Invalid store configuration', } export function loadConfigAndListErrors(): { @@ -212,7 +213,7 @@ export function loadConfigAndListErrors(): { store = baseConfig.store; } // for now, this works - { + try { store.detectCredentials ??= true; store.accessKey = env.getEnvRaw( @@ -240,6 +241,15 @@ export function loadConfigAndListErrors(): { env.getEnvRaw('DIRECT_RESPONSE_ATTACHMENT', false), store.proxyAttachments ?? false ); + } catch (e) { + errors.push({ + name: ErrTitle.INVALID_STORE_CONFIG, + description: 'Could not load configuration for store', + severity: IssueSeverity.FATAL_ERROR, + category: IssueCategory.CONFIG, + cause: coerceToValidCause(e), + fixes: [] + }); } let server: ServerConfiguration;