Skip to content

Commit

Permalink
code cleanup - better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Feb 7, 2020
1 parent 4a144b4 commit 0664e9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/tmp.js
Expand Up @@ -602,12 +602,15 @@ function _isENOENT(error) {
*
* - Node >= 7.0:
* error.code {string}
* error.errno {string|number} any numerical value will be negated
* error.errno {number} any numerical value will be negated
*
* @param {SystemError} error
* @param {number} errno
* @param {string} code
* @private
*/
function _isExpectedError(error, code, errno) {
return error.code === code || error.code === errno;
function _isExpectedError(error, errno, code) {
return error.code === code && error.errno === errno;
}

/**
Expand Down

0 comments on commit 0664e9a

Please sign in to comment.