From 6deabcd603055786311994cb25c8c9282ff9971d Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 9 Nov 2023 09:36:00 -0600 Subject: [PATCH 1/3] fix: http 420 errors --- src/org/org.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/org/org.ts b/src/org/org.ts index c061b89b3f..e498e08332 100644 --- a/src/org/org.ts +++ b/src/org/org.ts @@ -699,7 +699,24 @@ export class Org extends AsyncOptionalCreatable { 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(' Date: Thu, 9 Nov 2023 09:43:44 -0600 Subject: [PATCH 2/3] refactor: use messages for text --- messages/org.md | 10 ++++++++++ src/org/org.ts | 10 +--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/messages/org.md b/messages/org.md index d4dddcc81e..cbb345a13c 100644 --- a/messages/org.md +++ b/messages/org.md @@ -65,3 +65,13 @@ We found more than one SandboxProcess with the SandboxName %s. # sandboxNotResumable The sandbox %s cannot resume with status of %s. + +# UnexpectedResponse + +Unexpected response from the platform + +# UnexpectedResponse.actions + +- Check that the instance URL is correct and the org still exists. + +See what's at the URL that's causing the problem: %s. diff --git a/src/org/org.ts b/src/org/org.ts index e498e08332..d6cdec5fa0 100644 --- a/src/org/org.ts +++ b/src/org/org.ts @@ -705,15 +705,7 @@ export class Org extends AsyncOptionalCreatable { // 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(' Date: Thu, 9 Nov 2023 09:51:32 -0600 Subject: [PATCH 3/3] style: missing hyphen --- messages/org.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/org.md b/messages/org.md index cbb345a13c..97524ef844 100644 --- a/messages/org.md +++ b/messages/org.md @@ -74,4 +74,4 @@ Unexpected response from the platform - Check that the instance URL is correct and the org still exists. -See what's at the URL that's causing the problem: %s. +- See what's at the URL that's causing the problem: %s.