Add error stack trace for ValidationError

The issue was initially reported by SLA-370.
This commit is contained in:
Raymond Feng 2013-09-09 10:12:12 -07:00
parent 0d303de917
commit f4d62e54e6
1 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,4 @@
var util = require('util');
/**
* Module exports
*/
@ -604,6 +605,7 @@ function ValidationError(obj) {
this.context = obj && obj.constructor && obj.constructor.modelName;
Error.call(this);
};
Error.captureStackTrace(this, this.constructor);
}
ValidationError.prototype.__proto__ = Error.prototype;
util.inherits(ValidationError, Error);