diff --git a/stories/index.stories.tsx b/stories/index.stories.tsx index 7dc8e08..3297447 100644 --- a/stories/index.stories.tsx +++ b/stories/index.stories.tsx @@ -25,9 +25,13 @@ storiesOf("Hello World", module) onProgress(done / total); } }); - xhr.addEventListener("readystatechange", e => { + xhr.addEventListener("readystatechange", () => { if (xhr.readyState === 4) { - onSuccess(xhr.response); + if (xhr.status === 200) { + onSuccess(xhr.response); + } else { + onError(); + } } });