Added catch on fail resize
This commit is contained in:
parent
2c03395371
commit
3e466925d6
1 changed files with 10 additions and 8 deletions
|
@ -24,7 +24,8 @@ class Resize {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
resizeImg(data, this.size).then(buf => {
|
resizeImg(data, this.size)
|
||||||
|
.then(buf => {
|
||||||
fs.writeFile(output, buf, (err) => {
|
fs.writeFile(output, buf, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(err, null)
|
callback(err, null)
|
||||||
|
@ -33,6 +34,7 @@ class Resize {
|
||||||
callback(null, { input: input, output: output, size: this.size })
|
callback(null, { input: input, output: output, size: this.size })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
.catch(callback)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue