clear declarations

This commit is contained in:
Ilya Kantor 2019-05-26 09:01:14 +03:00
parent 9b03ee79bd
commit 49fbecca83
2 changed files with 0 additions and 31 deletions

View file

@ -10,25 +10,6 @@ function loadScript(src) {
document.head.append(script);
});
}
class HttpError extends Error {
constructor(response) {
super(`${response.status} for ${response.url}`);
this.name = 'HttpError';
this.response = response;
}
}
function loadJson(url) {
return fetch(url)
.then(response => {
if (response.status == 200) {
return response.json();
} else {
throw new HttpError(response);
}
})
}
</script>
<style>