MagicMirror/js/fetcher_helper.js

13 lines
245 B
JavaScript
Raw Normal View History

const FetcherHelper = {
checkStatus: function (response) {
// response.status >= 200 && response.status < 300
if (response.ok) {
return response;
} else {
throw Error(response.statusText);
}
}
};
module.exports = FetcherHelper;