Skip to content

Commit

Permalink
add error normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
particlebanana committed Feb 5, 2016
1 parent 74365fa commit 6fad3d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/connections/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ module.exports = function spawnConnection (connectionObject, fn, cb__spawnConnec

// Release the connection, then pass control back to Waterline core.
connectionObject.connection.releaseConnection(liveConnection, function sendBackError ( /* thisErrDoesntMatter */ ) {

// Normalize the errors a bit. There could be a formattedErr if we inspect
// and augment the error. But to ensure compatibility with other adapters attach an
// originalError key to th error.
err.originalError = err;

cb__spawnConnection(err);
});
return;
Expand Down

0 comments on commit 6fad3d5

Please sign in to comment.