diff options
author | Ajay Ramachandran <[email protected]> | 2022-08-22 23:21:39 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-08-22 23:21:39 -0400 |
commit | f05d081cd6f57132e92da87d477dd56b26d45963 (patch) | |
tree | 3f2877412f7a05493919f4813f82db250df36d9a | |
parent | 19e230ea6abbe6faf48cc590c9e8595534b7f214 (diff) | |
parent | aadc1be56cd9e3be31bc638f725ead013f6a801a (diff) | |
download | SponsorBlock-f05d081cd6f57132e92da87d477dd56b26d45963.tar.gz SponsorBlock-f05d081cd6f57132e92da87d477dd56b26d45963.zip |
Merge pull request #1459 from mchangrh/no-html-error
catch all html in error messages
-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 0718d788..2d912a66 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 && !responseText.includes(`cf-wrapper`)) ? "\n\n" + responseText : ""); + const postFix = ((responseText && !(responseText.includes(`cf-wrapper`) || responseText.includes("<!DOCTYPE html>"))) ? "\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; |