Skip to content

Commit

Permalink
fix: should throw error with message
Browse files Browse the repository at this point in the history
  • Loading branch information
amphro committed Jan 28, 2021
1 parent 4fab128 commit 95d53dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion messages/web.login.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"sfdx auth:web:login -r https://test.salesforce.com"
],
"deviceWarning": "auth:web:login doesn't work when authorizing to a headless environment. Use auth:device:login instead.",
"invalidClientId": "Invalid client credentials. Verify the OAuth client secret and ID."
"invalidClientId": "Invalid client credentials. Verify the OAuth client secret and ID. %s"
}
7 changes: 3 additions & 4 deletions src/commands/auth/web/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ export default class Login extends SfdxCommand {
this.ux.log(successMsg);
return fields;
} catch (err) {
this.logger.debug(err);
if (err.name === 'AuthCodeExchangeError') {
this.ux.error(messages.getMessage('invalidClientId'));
} else {
this.ux.error(err.message);
throw new SfdxError(messages.getMessage('invalidClientId', [err.message]));
}
return {};
throw err;
}
}

Expand Down

0 comments on commit 95d53dd

Please sign in to comment.