From 924c77773603700b50326d2165748a1eee8a3315 Mon Sep 17 00:00:00 2001 From: Michael C Date: Fri, 11 Mar 2022 23:52:30 -0500 Subject: [PATCH] ignore body if cloudflare error found --- src/utils/genericUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/genericUtils.ts b/src/utils/genericUtils.ts index bd27de8c..a11f9c4c 100644 --- a/src/utils/genericUtils.ts +++ b/src/utils/genericUtils.ts @@ -28,7 +28,7 @@ async function wait(condition: () => T | false, timeout = 5000, check = 100): * @returns {string} errorMessage */ function getErrorMessage(statusCode: number, responseText: string): string { - const postFix = (responseText ? "\n\n" + responseText : ""); + const postFix = ((responseText && !responseText.includes(`cf-wrapper`)) ? "\n\n" + responseText : ""); // display response body for 4xx if([400, 429, 409, 0].includes(statusCode)) { return chrome.i18n.getMessage(statusCode + "") + " " + chrome.i18n.getMessage("errorCode") + statusCode + postFix;