more detail msg if error loading image

master
JFH 2021-05-27 21:07:02 +02:00
parent 9dd0b8e639
commit 5a318574e7
1 changed files with 2 additions and 2 deletions

View File

@ -649,8 +649,8 @@ export const embedImage = function (src) {
svgContext_.getCanvas().setGoodImage(src);
resolve(svgContext_.getEncodableImages(src));
});
imgI.addEventListener("error", () => {
reject(new Error('Error loading image: '));
imgI.addEventListener("error", (e) => {
reject(new Error(`error loading image: ${e.currentTarget.attributes.src.value}`));
});
imgI.setAttribute('src', src);
});