mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 11:03:37 +00:00
Added checkFetchStatus function and fetch will use it.
This commit is contained in:
7
client/funcs/checkFetchStatus.js
Normal file
7
client/funcs/checkFetchStatus.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = function (response) {
|
||||
if (response.ok) { // res.status >= 200 && res.status < 300
|
||||
return response;
|
||||
} else {
|
||||
throw new Error(response.status + " " + response.statusText);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user