Skip to content

Commit

Permalink
refactor: change start behavior on missing credentials
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Barbosa <[email protected]>
  • Loading branch information
t1agob committed Feb 14, 2024
1 parent 431de63 commit 2d78299
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ export async function loadAuthConfig(logger: Logger, config: Config) {
if (!config.getOptional('pagerDuty.oauth')) {

logger.error('No PagerDuty OAuth configuration found in config file.');
throw new Error("No PagerDuty 'apiToken' or 'oauth' configuration found in config file.");

} else if (!config.getOptionalString('pagerDuty.oauth.clientId') || !config.getOptionalString('pagerDuty.oauth.clientSecret') || !config.getOptionalString('pagerDuty.oauth.subDomain')) {

logger.error("Missing required PagerDuty OAuth parameters in config file. 'clientId', 'clientSecret', and 'subDomain' are required. 'region' is optional.");
throw new Error('Missing required PagerDuty OAuth parameters in config file.');

} else {

Expand All @@ -68,7 +66,6 @@ export async function loadAuthConfig(logger: Logger, config: Config) {
}
catch (error) {
logger.error(`Unable to retrieve valid PagerDuty AUTH configuration from config file: ${error}`);
throw error;
}
}

Expand Down

0 comments on commit 2d78299

Please sign in to comment.