From 49fbecca83d40656abf20836584f87a8da4f8721 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sun, 26 May 2019 09:01:14 +0300 Subject: [PATCH] clear declarations --- 1-js/11-async/03-promise-chaining/head.html | 19 ------------------- .../04-promise-error-handling/head.html | 12 ------------ 2 files changed, 31 deletions(-) diff --git a/1-js/11-async/03-promise-chaining/head.html b/1-js/11-async/03-promise-chaining/head.html index 31c6b427..0a0075fb 100644 --- a/1-js/11-async/03-promise-chaining/head.html +++ b/1-js/11-async/03-promise-chaining/head.html @@ -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); - } - }) -}