We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecac864 commit 7bea39eCopy full SHA for 7bea39e
packages/server/service/fetcher.ts
@@ -15,7 +15,10 @@ const fetch = (url: string, type: 'get' | 'post' = 'get') => {
15
get(target, prop) {
16
if (prop === 'then') {
17
return (...args) => target.then((res) => {
18
- if (res.status !== 200) throw new Error(`Failed to ${type} ${endpoint} : ${res.status} - ${JSON.stringify(res.body || {})}`);
+ if (![200, 204].includes(res.status)) {
19
+ logger.error(`Failed to ${type} ${url} : ${res.status} - ${JSON.stringify(res.body || {})}`);
20
+ throw new Error(`Failed to ${type} ${endpoint} : ${res.status} - ${JSON.stringify(res.body || {})}`);
21
+ }
22
return res;
23
}).then(...args);
24
}
0 commit comments