From 5958c80ab7d3ae52bd09b04eca33740470e7a6fd Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Wed, 3 Mar 2021 20:18:44 +0100 Subject: [PATCH] Avoid error if response code is < 500 --- src/scripts/network-helper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scripts/network-helper.ts b/src/scripts/network-helper.ts index b35890d..8a6272c 100644 --- a/src/scripts/network-helper.ts +++ b/src/scripts/network-helper.ts @@ -39,6 +39,9 @@ const commonConfig = { * Jar of cookies to send along the request. */ jar: shared.session.cookieJar, + validateStatus: function (status: number) { + return status < 500; // Resolve only if the status code is less than 500 + } }; /** @@ -143,6 +146,7 @@ export async function fetchGETResponse(url: string): Promise