Skip to content

Commit

Permalink
fix: http 420 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 9, 2023
1 parent b3c1d6b commit 6deabcd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/org/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,24 @@ export class Org extends AsyncOptionalCreatable<Org.Options> {
method: 'GET',
};
const conn = this.getConnection();
await conn.request(requestInfo);
try {
await conn.request(requestInfo);
} catch (e) {
// an html error page like https://computing-connect-6970-dev-ed.scratch.my.salesforce.com/services/data/v50.0
// where the message is an entire html page
if (e instanceof Error && (e.name.includes('ERROR_HTTP') || e.message.includes('<html '))) {
throw new SfError(
'Unexpected response from the platform',
'UnexpectedResponse',
[
'Check that the instance URL is correct and the org still exists.',
`See what's at the URL that's causing the problem: ${conn.baseUrl()}`,
],
e
);
}
throw e;
}
}

/**
Expand Down

4 comments on commit 6deabcd

@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: 6deabcd Previous: 29c59e0 Ratio
Child logger creation 296910 ops/sec (±11.44%) 699481 ops/sec (±1.56%) 2.36
Logging a string on root logger 554513 ops/sec (±8.82%) 791610 ops/sec (±5.90%) 1.43
Logging an object on root logger 391193 ops/sec (±14.82%) 603986 ops/sec (±7.67%) 1.54
Logging an object with a message on root logger 263703 ops/sec (±14.40%) 8806 ops/sec (±205.56%) 0.033393628438053415
Logging an object with a redacted prop on root logger 276074 ops/sec (±16.37%) 432979 ops/sec (±9.52%) 1.57
Logging a nested 3-level object on root logger 1139 ops/sec (±276.37%) 365611 ops/sec (±9.13%) 320.99

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: 6deabcd Previous: 29c59e0 Ratio
Child logger creation 296910 ops/sec (±11.44%) 699481 ops/sec (±1.56%) 2.36
Logging a nested 3-level object on root logger 1139 ops/sec (±276.37%) 365611 ops/sec (±9.13%) 320.99

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: 6deabcd Previous: 29c59e0 Ratio
Child logger creation 313520 ops/sec (±0.80%) 587812 ops/sec (±0.54%) 1.87
Logging a string on root logger 712419 ops/sec (±5.79%) 763983 ops/sec (±6.94%) 1.07
Logging an object on root logger 576034 ops/sec (±9.04%) 513955 ops/sec (±9.03%) 0.89
Logging an object with a message on root logger 11843 ops/sec (±189.20%) 294241 ops/sec (±10.56%) 24.85
Logging an object with a redacted prop on root logger 455969 ops/sec (±6.60%) 2627 ops/sec (±275.01%) 0.005761356583451945
Logging a nested 3-level object on root logger 321664 ops/sec (±6.18%) 274455 ops/sec (±6.14%) 0.85

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 - windows-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6deabcd Previous: 29c59e0 Ratio
Logging an object with a message on root logger 11843 ops/sec (±189.20%) 294241 ops/sec (±10.56%) 24.85

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

Please sign in to comment.