Skip to content

Commit

Permalink
change(config): Temporary solution for errors when loading store config
Browse files Browse the repository at this point in the history
  • Loading branch information
tecc committed Nov 11, 2022
1 parent b038f16 commit 3131298
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libs/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(): {
Expand Down Expand Up @@ -212,7 +213,7 @@ export function loadConfigAndListErrors(): {
store = baseConfig.store;
}
// for now, this works
{
try {
store.detectCredentials ??= true;
store.accessKey =
env.getEnvRaw(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3131298

Please sign in to comment.