From 8a7efdfc5949dca618a91c35f866de4694d1217a Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Mon, 18 May 2015 01:01:35 -0700 Subject: [PATCH] handle error status codes when fetching files we were completely falling over on a simple 404, which is dumb. --- loader.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loader.js b/loader.js index 952f451..666d60d 100644 --- a/loader.js +++ b/loader.js @@ -740,6 +740,12 @@ var Module = null; if (xhr.status === 200) { success(); resolve(xhr.response); + } else if (optional) { + success(); + resolve(null); + } else { + failure(); + reject(); } }; xhr.onerror = function (e) {