aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2022-08-22 23:21:39 -0400
committerGitHub <[email protected]>2022-08-22 23:21:39 -0400
commitf05d081cd6f57132e92da87d477dd56b26d45963 (patch)
tree3f2877412f7a05493919f4813f82db250df36d9a
parent19e230ea6abbe6faf48cc590c9e8595534b7f214 (diff)
parentaadc1be56cd9e3be31bc638f725ead013f6a801a (diff)
downloadSponsorBlock-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.ts2
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;