errors.js
816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
/**
* @fileOverview The Error Objects produced by Sequelize.
*/
var error = module.exports = {};
/**
* The Base Error all Sequelize Errors inherit from.
*
* @constructor
*/
error.BaseError = function() {
var tmp = Error.apply(this, arguments);
tmp.name = this.name = 'SequelizeBaseError';
this.stack = tmp.stack;
this.message = tmp.message;
return this;
};
error.BaseError.prototype = Object.create(Error.prototype, {
constructor: { value: error.BaseError }
});
/**
* Validation Error
*
* @constructor
*/
error.ValidationError = function() {
error.BaseError.apply(this, arguments);
this.name = 'SequelizeValidationError';
return this;
};
error.ValidationError.prototype = Object.create(error.BaseError.prototype, {
constructor: { value: error.ValidationError }
});