mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
16
node_modules/mongoose/lib/error/validator.js
generated
vendored
16
node_modules/mongoose/lib/error/validator.js
generated
vendored
@@ -13,7 +13,7 @@ var errorMessages = MongooseError.messages;
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function ValidatorError (properties) {
|
||||
function ValidatorError(properties) {
|
||||
var msg = properties.message;
|
||||
if (!msg) {
|
||||
msg = errorMessages.general.default;
|
||||
@@ -22,12 +22,16 @@ function ValidatorError (properties) {
|
||||
this.properties = properties;
|
||||
var message = this.formatMessage(msg, properties);
|
||||
MongooseError.call(this, message);
|
||||
this.stack = new Error().stack;
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this);
|
||||
} else {
|
||||
this.stack = new Error().stack;
|
||||
}
|
||||
this.name = 'ValidatorError';
|
||||
this.kind = properties.type;
|
||||
this.path = properties.path;
|
||||
this.value = properties.value;
|
||||
};
|
||||
}
|
||||
|
||||
/*!
|
||||
* Inherits from MongooseError
|
||||
@@ -40,7 +44,7 @@ ValidatorError.prototype.constructor = MongooseError;
|
||||
* Formats error messages
|
||||
*/
|
||||
|
||||
ValidatorError.prototype.formatMessage = function (msg, properties) {
|
||||
ValidatorError.prototype.formatMessage = function(msg, properties) {
|
||||
var propertyNames = Object.keys(properties);
|
||||
for (var i = 0; i < propertyNames.length; ++i) {
|
||||
var propertyName = propertyNames[i];
|
||||
@@ -56,9 +60,9 @@ ValidatorError.prototype.formatMessage = function (msg, properties) {
|
||||
* toString helper
|
||||
*/
|
||||
|
||||
ValidatorError.prototype.toString = function () {
|
||||
ValidatorError.prototype.toString = function() {
|
||||
return this.message;
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* exports
|
||||
|
||||
Reference in New Issue
Block a user