From 18d959ef16498e53bf9c7b42004a568a9cc9f4a9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 12 May 2017 17:07:30 +0200 Subject: [PATCH] handle non-200 status codes --- www/common/common-util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/common/common-util.js b/www/common/common-util.js index bbd648f7c..7f735411e 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -101,11 +101,11 @@ define([], function () { xhr.open("GET", src, true); xhr.responseType = "arraybuffer"; xhr.onload = function () { + if (this.status !== 200) { + return CB('XHR_ERROR'); + } return void CB(void 0, new Uint8Array(xhr.response)); }; - xhr.onerror = function () { - CB('XHR_ERROR'); - }; xhr.send(null); };