fix: log an error when images cannot be decoded (#1849)
This commit is contained in:
parent
5a9e5ae8bc
commit
08c021bc56
|
@ -37,9 +37,11 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async oncreate () {
|
async oncreate () {
|
||||||
|
const { node } = this.refs
|
||||||
try {
|
try {
|
||||||
await decodeImage(this.refs.node)
|
await decodeImage(node)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('Image decode error', node && node.src, e)
|
||||||
this.set({ error: true })
|
this.set({ error: true })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue