Skip to content

Commit

Permalink
Log error when fetching setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferlund committed Dec 15, 2023
1 parent 55a08e5 commit 3b3116b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/discord-bot/src/utils/settingsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ export const getSetting = async (
? res.data[0].valueRealized
: getDefaultSetting(key);
})
.catch(() => getDefaultSetting(key));
.catch((err) => {
logger.error(
`Error while fetching setting ${key} from API, using default value`,
err
);
return getDefaultSetting(key);
});

// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
logger.debug(`Setting ${key} is ${setting}`);
Expand Down

0 comments on commit 3b3116b

Please sign in to comment.