fix: log an error when images cannot be decoded (#1849)

This commit is contained in:
Nolan Lawson 2020-08-27 08:49:22 -07:00 committed by GitHub
parent 5a9e5ae8bc
commit 08c021bc56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 })
} }
}, },