1
0
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:
2016-01-05 12:28:04 -06:00
parent 4bb8cae81e
commit 6ab45fe935
13249 changed files with 317868 additions and 2101398 deletions

View File

@@ -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