Fix: better error message

This commit is contained in:
eight 2017-08-30 17:40:19 +08:00
parent dece4b57f3
commit 7b9348a545

View File

@ -23,7 +23,7 @@ var loadScript = (function () {
cache.set(path, script); cache.set(path, script);
}; };
script.onerror = event => { script.onerror = event => {
reject(event); reject(new Error(`failed to load script: ${path}`));
script.onload = null; script.onload = null;
script.onerror = null; script.onerror = null;
script.parentNode.removeChild(script); script.parentNode.removeChild(script);