Skip to content

Commit

Permalink
More error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Sep 2, 2022
1 parent a6f004e commit 2540767
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/common/helpers/rest-calls/index.ts
Expand Up @@ -116,7 +116,16 @@ export const useMasaQuery = (
mode: 'cors',
body: JSON.stringify(body),
})
.then((res) => res.json())
.then((res) => {
console.log("LAS RESPONSE", res);
if (!res.ok) {
console.log('NOT OK');
}
if (res.status > 399) {
throw new Error("ERR");
}
return res.json();
})
.catch((err) => {
console.log('CALL ERROR', err);
throw new Error(err);
Expand Down

0 comments on commit 2540767

Please sign in to comment.