loader error callback fix

This commit is contained in:
Yuri Kuznetsov
2025-11-01 15:53:04 +02:00
parent 6e2416dc56
commit 876b74aefc

View File

@@ -763,7 +763,7 @@
}
console.warn(`Could not obtain ${id}.`);
});
}, errorCallback);
return;
}
@@ -792,9 +792,10 @@
* @private
* @param {string} url
* @param {function} callback
* @param {function|null} [errorCallback]
* @return {Promise}
*/
_addScript(url, callback) {
_addScript(url, callback, errorCallback = null) {
const script = document.createElement('script');
script.src = url;
@@ -802,6 +803,10 @@
script.addEventListener('error', e => {
console.error(`Could not load script '${url}'.`, e);
if (errorCallback) {
errorCallback();
}
});
document.head.appendChild(script);