diff options
author | Michael C <[email protected]> | 2022-03-11 23:52:30 -0500 |
---|---|---|
committer | Michael C <[email protected]> | 2022-03-11 23:52:30 -0500 |
commit | 924c77773603700b50326d2165748a1eee8a3315 (patch) | |
tree | d891055482005da331f34fd273647bdc57b207d6 | |
parent | 405fb342f0a288bc4c33a247719b9d467a1f38d7 (diff) | |
download | SponsorBlock-924c77773603700b50326d2165748a1eee8a3315.tar.gz SponsorBlock-924c77773603700b50326d2165748a1eee8a3315.zip |
ignore body if cloudflare error found
-rw-r--r-- | src/utils/genericUtils.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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<T>(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; |