Skip to content

Commit

Permalink
Catch errors thrown by onInclude
Browse files Browse the repository at this point in the history
When using the `.then($1, $2)` function, any errors thrown from `$1` will *not* be delegated to `$2`. Changing to `.then($1).catch($2)` makes sure that even errors from `$1` gets delegated to `$2`.

Found by this proposed standard rule: standard/eslint-config-standard#129
  • Loading branch information
LinusU committed Aug 27, 2018
1 parent 402c1d0 commit 6f2ac5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/copy/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function handleFilter (onInclude, destStat, src, dest, opts, cb) {
return onInclude(src, dest, opts, cb)
}
return cb()
}, error => cb(error))
}).catch(error => cb(error))
}

function startCopy (destStat, src, dest, opts, cb) {
Expand Down

0 comments on commit 6f2ac5f

Please sign in to comment.