Skip to content

Commit

Permalink
Merge pull request #394 from shicks/master
Browse files Browse the repository at this point in the history
Avoid leaking unhandled rejections
  • Loading branch information
webketje committed Sep 10, 2023
2 parents 4b454be + cac48fc commit 878fb79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ Metalsmith.prototype.build = function (callback) {
if (err) {
if (isFunction(callback)) {
callback(err)
return
}
reject(err)
return
Expand Down Expand Up @@ -555,7 +556,7 @@ Metalsmith.prototype.process = function (callback) {
const msWatcher = watcher(files, this)
msWatcher(this[symbol.watch], callback).then((close) => {
this[symbol.closeWatcher] = close
})
}, callback)
})
} else {
result = result.then((files) => this.run(files, this.plugins))
Expand Down

0 comments on commit 878fb79

Please sign in to comment.