From dd6bd6ef1473639f18d856255158ef24ee00a626 Mon Sep 17 00:00:00 2001 From: mcibique Date: Mon, 7 Mar 2022 13:23:11 +0000 Subject: [PATCH] ONL-6389: fix: Prevent raising ProgressEvent when there is XHR error while loading inline SVGs. (#1100) --- src/icons/loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icons/loader.js b/src/icons/loader.js index 5fb3fc529..6c89280d1 100644 --- a/src/icons/loader.js +++ b/src/icons/loader.js @@ -19,8 +19,8 @@ function getSprite(url) { resolve(xhr.responseText); } }; - xhr.onerror = function onSpriteError(err) { - reject(err); + xhr.onerror = function onSpriteError() { + reject(new Error(`Unexpected error when loading svg sprite. Status: ${xhr.status}`)); }; xhr.send(); }));