Files
MagicMirror/js/fetcher_helper.js
2021-05-19 11:12:42 +02:00

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;