Skip to content

Commit

Permalink
fix: update error message for sfdx auth url
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Sep 11, 2024
1 parent 7994793 commit 96f1dd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions messages/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Errors encountered:

Error authenticating with the refresh token due to: %s

# invalidSfdxAuthUrlError

Invalid SFDX auth URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX auth URL doesn\'t include a protocol ("https://").

# orgDataNotAvailableError

An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired.
Expand Down
10 changes: 4 additions & 6 deletions src/org/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,7 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
);

if (!match) {
throw new SfError(
'Invalid SFDX auth URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the SFDX auth URL uses the "force" protocol, and not "http" or "https". Also note that the "instanceUrl" inside the SFDX auth URL doesn\'t include the protocol ("https://").',
'INVALID_SFDX_AUTH_URL'
);
throw new SfError(messages.getMessage('invalidSfdxAuthUrlError'), 'INVALID_SFDX_AUTH_URL');
}
const [, clientId, clientSecret, refreshToken, loginUrl] = match;
return {
Expand Down Expand Up @@ -1073,8 +1070,9 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
let authFieldsBuilder: TokenResponse;
try {
authFieldsBuilder = await oauth2.refreshToken(ensure(fullOptions.refreshToken));
} catch (err) {
throw messages.createError('refreshTokenAuthError', [(err as Error).message]);
} catch (err: unknown) {
const cause = err instanceof Error ? err : SfError.wrap(err);
throw messages.createError('refreshTokenAuthError', [cause.message], undefined, cause);
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down

3 comments on commit 96f1dd4

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 96f1dd4 Previous: bb3dcff Ratio
Child logger creation 472358 ops/sec (±0.62%) 466451 ops/sec (±1.06%) 0.99
Logging a string on root logger 802686 ops/sec (±7.54%) 860742 ops/sec (±10.73%) 1.07
Logging an object on root logger 558755 ops/sec (±6.89%) 596456 ops/sec (±9.02%) 1.07
Logging an object with a message on root logger 7506 ops/sec (±205.42%) 22307 ops/sec (±184.18%) 2.97
Logging an object with a redacted prop on root logger 392249 ops/sec (±14.56%) 441725 ops/sec (±6.97%) 1.13
Logging a nested 3-level object on root logger 356677 ops/sec (±7.93%) 345206 ops/sec (±9.22%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 96f1dd4 Previous: bb3dcff Ratio
Logging an object with a message on root logger 7506 ops/sec (±205.42%) 22307 ops/sec (±184.18%) 2.97

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 96f1dd4 Previous: bb3dcff Ratio
Child logger creation 318403 ops/sec (±1.00%) 332707 ops/sec (±0.73%) 1.04
Logging a string on root logger 708783 ops/sec (±4.71%) 797040 ops/sec (±6.26%) 1.12
Logging an object on root logger 596399 ops/sec (±6.35%) 604977 ops/sec (±5.21%) 1.01
Logging an object with a message on root logger 10615 ops/sec (±190.14%) 2967 ops/sec (±228.42%) 0.28
Logging an object with a redacted prop on root logger 519459 ops/sec (±7.64%) 439229 ops/sec (±13.12%) 0.85
Logging a nested 3-level object on root logger 321273 ops/sec (±5.46%) 342878 ops/sec (±7.99%) 1.07

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.