不要怂,就是干,撸起袖子干!

Commit 5c050202 by Brian Romanko

Fixing stack trace capturing and switching back to util.inerhits

1 parent 43a43edc
Showing with 4 additions and 11 deletions
......@@ -4,6 +4,7 @@
* @fileOverview The Error Objects produced by Sequelize.
*/
var util = require('util');
var error = module.exports = {};
/**
......@@ -15,14 +16,10 @@ error.BaseError = function() {
var tmp = Error.apply(this, arguments);
tmp.name = this.name = 'SequelizeBaseError';
this.stack = tmp.stack;
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
this.message = tmp.message;
return this;
};
error.BaseError.prototype = Object.create(Error.prototype, {
constructor: { value: error.BaseError }
});
util.inherits(error.BaseError, Error);
/**
......@@ -34,12 +31,8 @@ error.ValidationError = function(message, errors) {
error.BaseError.apply(this, arguments);
this.name = 'SequelizeValidationError';
this.errors = errors || [];
return this;
};
error.ValidationError.prototype = Object.create(error.BaseError.prototype, {
constructor: { value: error.ValidationError }
});
util.inherits(error.ValidationError, error.BaseError);
/**
* Finds all validation error items for the path specified.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!