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
1 changed files with 3 additions and 1 deletions

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