diff --git a/lib/waterline/error/WLError.js b/lib/waterline/error/WLError.js index fb9993d7a..e571b8ed3 100644 --- a/lib/waterline/error/WLError.js +++ b/lib/waterline/error/WLError.js @@ -26,7 +26,7 @@ function WLError(properties) { } // Doctor up a modified version of the stack trace called `rawStack`: - this.rawStack = (this._e.stack.replace(/^Error(\r|\n)*(\r|\n)*/, '')); + this.rawStack = (this._e && this._e.stask && this._e.stack.replace(/^Error(\r|\n)*(\r|\n)*/, '') || ''); // Customize `details`: // Try to dress up the wrapped "original" error as much as possible.