mirror of https://github.com/curbengh/hexo-yam
fix: reject a promise with an error object
- resolve "Unhandled promise rejection" error - https://stackoverflow.com/a/47803880
This commit is contained in:
parent
9df4e8283b
commit
932d36182c
|
@ -120,8 +120,7 @@ function minifySvg () {
|
|||
if (options.logger) verbose.call(this, assetTxt, data, path, 'svg')
|
||||
resolve(route.set(path, data))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
throw new Error(err)
|
||||
reject(new Error(err))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -156,8 +155,7 @@ function gzipFn () {
|
|||
if (options.logger) verbose.call(this, input, result, path, 'gzip')
|
||||
resolve(route.set(path + '.gz', result))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
throw new Error(err)
|
||||
reject(new Error(err))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -191,8 +189,7 @@ function brotliFn () {
|
|||
if (options.logger) verbose.call(this, input, result, path, 'brotli')
|
||||
resolve(route.set(path + '.br', result))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
throw new Error(err)
|
||||
reject(new Error(err))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue