mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2026-10-29 19:25:01 +00:00
Added checkFetchStatus function and fetch will use it.
This commit is contained in:
1 parent
368b8d2364
commit
3fee7bb40a
3 files changed
+21
-7
No files matched your search
@@ -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