mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 02:27:37 +00:00
Handle img load errors by rejecting the promise
This commit is contained in:
parent
5c54dd72df
commit
eb18a195e3
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ async function loadImage(imgUrl) {
|
|||
img.addEventListener("load", () => {
|
||||
resolve(img);
|
||||
});
|
||||
img.addEventListener("error", e => {
|
||||
reject(e);
|
||||
});
|
||||
img.src = imgUrl;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue