Skip to content

Commit

Permalink
work around bluebird error wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Aug 4, 2014
1 parent be422bd commit bd5126e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ecstacy.js
Expand Up @@ -143,6 +143,10 @@ Ecstacy.prototype.readSafely = function (name, ext, encoding) {
}

function reject(err) {
// XXX: bluebird wraps the Error in its own class, for some reason
// see https://github.com/petkaantonov/bluebird#expected-and-unexpected-errors
if (err.name === 'OperationalError' && err.cause)
err = err.cause
debug('read error: "%s"', err.stack)
if (err.code !== 'ENOENT') throw err
}
Expand Down

0 comments on commit bd5126e

Please sign in to comment.