Skip to content

Commit 95d53dd

Browse files
committed
fix: should throw error with message
1 parent 4fab128 commit 95d53dd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

messages/web.login.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"sfdx auth:web:login -r https://test.salesforce.com"
77
],
88
"deviceWarning": "auth:web:login doesn't work when authorizing to a headless environment. Use auth:device:login instead.",
9-
"invalidClientId": "Invalid client credentials. Verify the OAuth client secret and ID."
9+
"invalidClientId": "Invalid client credentials. Verify the OAuth client secret and ID. %s"
1010
}

src/commands/auth/web/login.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ export default class Login extends SfdxCommand {
8080
this.ux.log(successMsg);
8181
return fields;
8282
} catch (err) {
83+
this.logger.debug(err);
8384
if (err.name === 'AuthCodeExchangeError') {
84-
this.ux.error(messages.getMessage('invalidClientId'));
85-
} else {
86-
this.ux.error(err.message);
85+
throw new SfdxError(messages.getMessage('invalidClientId', [err.message]));
8786
}
88-
return {};
87+
throw err;
8988
}
9089
}
9190

0 commit comments

Comments
 (0)