From 216f8bede93028b2cf304a2100fadb89132054e1 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 1 Mar 2023 00:01:56 +0000 Subject: [PATCH] fix request functionr return values Signed-off-by: Arthur Lu --- scripts/utils.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 59dddeb..e501822 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -138,15 +138,9 @@ export async function requestAPI (path, method, body = null) { async function request (url, content) { let response = await fetch(url, content) .then((response) => { - if (!response.ok) { - throw new ResponseError(`recieved response status code ${response.status}`); - } return response; }) .catch((error) => { - if (error instanceof ResponseError) { - throw error; - } throw new NetworkError(error); });