mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
13 lines
245 B
JavaScript
13 lines
245 B
JavaScript
|
const FetcherHelper = {
|
||
|
checkStatus: function (response) {
|
||
|
// response.status >= 200 && response.status < 300
|
||
|
if (response.ok) {
|
||
|
return response;
|
||
|
} else {
|
||
|
throw Error(response.statusText);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = FetcherHelper;
|