From 71df365c0ef8c15390ece9b594cc716fc0feb29d Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 9 Sep 2023 17:58:11 +0200 Subject: [PATCH] Updated the RequestUtil.js --- src/common/utils/RequestUtil.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils/RequestUtil.js b/src/common/utils/RequestUtil.js index c652516..3db8f00 100644 --- a/src/common/utils/RequestUtil.js +++ b/src/common/utils/RequestUtil.js @@ -14,9 +14,9 @@ export const request = async (url, method, body, headers) => { const rawData = await response.text(); const data = rawData ? JSON.parse(rawData) : rawData.toString(); - if (data.code >= 300) throw new Error(data.message); + if (data.code >= 300) throw data; - if (!response.ok) throw new Error(data.message); + if (!response.ok) throw data; return data; }