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

@@ -1,4 +1,4 @@
/* eslint no-unused-vars: 1 */
/*!
* Module dependencies.
*/
@@ -11,7 +11,7 @@ var MongooseError = require('../error.js');
* @inherits MongooseError
*/
function MissingSchemaError (name) {
function MissingSchemaError(name) {
var msg = 'Schema hasn\'t been registered for document.\n'
+ 'Use mongoose.Document(name, schema)';
MongooseError.call(this, msg);

View File

@@ -13,14 +13,19 @@ var MongooseError = require('../error.js');
* @api private
*/
function CastError (type, value, path) {
function CastError(type, value, path, reason) {
MongooseError.call(this, 'Cast to ' + type + ' failed for value "' + value + '" at path "' + path + '"');
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
if (Error.captureStackTrace) {
Error.captureStackTrace(this);
} else {
this.stack = new Error().stack;
}
this.name = 'CastError';
this.kind = type;
this.value = value;
this.path = path;
};
this.reason = reason;
}
/*!
* Inherits from MongooseError.

View File

@@ -11,7 +11,7 @@ var MongooseError = require('../error.js');
* @inherits MongooseError
*/
function DivergentArrayError (paths) {
function DivergentArrayError(paths) {
var msg = 'For your own good, using `document.save()` to update an array '
+ 'which was selected using an $elemMatch projection OR '
+ 'populated using skip, limit, query conditions, or exclusion of '
@@ -19,13 +19,13 @@ function DivergentArrayError (paths) {
+ 'the entire array is not supported. The following '
+ 'path(s) would have been modified unsafely:\n'
+ ' ' + paths.join('\n ') + '\n'
+ 'Use Model.update() to update these arrays instead.'
+ 'Use Model.update() to update these arrays instead.';
// TODO write up a docs page (FAQ) and link to it
MongooseError.call(this, msg);
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
this.name = 'DivergentArrayError';
};
}
/*!
* Inherits from MongooseError.

View File

@@ -11,7 +11,7 @@ var MongooseError = require('../error.js');
* @inherits MongooseError
*/
function MissingSchemaError (name) {
function MissingSchemaError(name) {
var msg = 'Schema hasn\'t been registered for model "' + name + '".\n'
+ 'Use mongoose.model(name, schema)';
MongooseError.call(this, msg);

View File

@@ -11,11 +11,11 @@ var MongooseError = require('../error.js');
* @inherits MongooseError
*/
function OverwriteModelError (name) {
function OverwriteModelError(name) {
MongooseError.call(this, 'Cannot overwrite `' + name + '` model once compiled.');
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
this.name = 'OverwriteModelError';
};
}
/*!
* Inherits from MongooseError.

35
node_modules/mongoose/lib/error/strict.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
/*!
* Module dependencies.
*/
var MongooseError = require('../error.js');
/**
* Strict mode error constructor
*
* @param {String} type
* @param {String} value
* @inherits MongooseError
* @api private
*/
function StrictModeError(path) {
MongooseError.call(this, 'Field `' + path + '` is not in schema and strict ' +
'mode is set to throw.');
if (Error.captureStackTrace) {
Error.captureStackTrace(this);
} else {
this.stack = new Error().stack;
}
this.name = 'StrictModeError';
this.path = path;
}
/*!
* Inherits from MongooseError.
*/
StrictModeError.prototype = Object.create(MongooseError.prototype);
StrictModeError.prototype.constructor = MongooseError;
module.exports = StrictModeError;

View File

@@ -13,13 +13,17 @@ var MongooseError = require('../error.js');
* @inherits MongooseError
*/
function ValidationError (instance) {
function ValidationError(instance) {
if (instance && instance.constructor.name === 'model') {
MongooseError.call(this, instance.constructor.modelName + " validation failed");
} else {
MongooseError.call(this, "Validation failed");
}
this.stack = new Error().stack;
if (Error.captureStackTrace) {
Error.captureStackTrace(this);
} else {
this.stack = new Error().stack;
}
this.name = 'ValidationError';
this.errors = {};
if (instance) {
@@ -39,11 +43,11 @@ ValidationError.prototype.constructor = MongooseError;
* Console.log helper
*/
ValidationError.prototype.toString = function () {
ValidationError.prototype.toString = function() {
var ret = this.name + ': ';
var msgs = [];
Object.keys(this.errors).forEach(function (key) {
Object.keys(this.errors).forEach(function(key) {
if (this == this.errors[key]) return;
msgs.push(String(this.errors[key]));
}, this);

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

View File

@@ -12,11 +12,11 @@ var MongooseError = require('../error.js');
* @api private
*/
function VersionError () {
function VersionError() {
MongooseError.call(this, 'No matching document found.');
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
this.name = 'VersionError';
};
}
/*!
* Inherits from MongooseError.