diff --git a/lib/connections/spawn.js b/lib/connections/spawn.js index 2632e434..30fed004 100644 --- a/lib/connections/spawn.js +++ b/lib/connections/spawn.js @@ -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;