diff options
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error')
12 files changed, 0 insertions, 527 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/browserMissingSchema.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/browserMissingSchema.js deleted file mode 100644 index 1c7892e..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/browserMissingSchema.js +++ /dev/null @@ -1,32 +0,0 @@ -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/*! - * MissingSchema Error constructor. - * - * @inherits MongooseError - */ - -function MissingSchemaError() { - var msg = 'Schema hasn\'t been registered for document.\n' - + 'Use mongoose.Document(name, schema)'; - MongooseError.call(this, msg); - Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee); - this.name = 'MissingSchemaError'; -} - -/*! - * Inherits from MongooseError. - */ - -MissingSchemaError.prototype = Object.create(MongooseError.prototype); -MissingSchemaError.prototype.constructor = MongooseError; - -/*! - * exports - */ - -module.exports = MissingSchemaError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/cast.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/cast.js deleted file mode 100644 index f200a9d..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/cast.js +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); -var util = require('util'); - -/** - * Casting Error constructor. - * - * @param {String} type - * @param {String} value - * @inherits MongooseError - * @api private - */ - -function CastError(type, value, path, reason) { - var stringValue = util.inspect(value); - stringValue = stringValue.replace(/^'/, '"').replace(/'$/, '"'); - if (stringValue.charAt(0) !== '"') { - stringValue = '"' + stringValue + '"'; - } - MongooseError.call(this, 'Cast to ' + type + ' failed for value ' + - stringValue + ' at path "' + path + '"'); - if (Error.captureStackTrace) { - Error.captureStackTrace(this); - } else { - this.stack = new Error().stack; - } - this.stringValue = stringValue; - this.name = 'CastError'; - this.kind = type; - this.value = value; - this.path = path; - this.reason = reason; -} - -/*! - * Inherits from MongooseError. - */ - -CastError.prototype = Object.create(MongooseError.prototype); -CastError.prototype.constructor = MongooseError; - -/*! - * ignore - */ - -CastError.prototype.setModel = function(model) { - this.model = model; - this.message = 'Cast to ' + this.kind + ' failed for value ' + - this.stringValue + ' at path "' + this.path + '"' + ' for model "' + - model.modelName + '"'; -}; - -/*! - * exports - */ - -module.exports = CastError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/disconnected.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/disconnected.js deleted file mode 100644 index b4eece1..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/disconnected.js +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/** - * Casting Error constructor. - * - * @param {String} type - * @param {String} value - * @inherits MongooseError - * @api private - */ - -function DisconnectedError(connectionString) { - MongooseError.call(this, 'Ran out of retries trying to reconnect to "' + - connectionString + '". Try setting `server.reconnectTries` and ' + - '`server.reconnectInterval` to something higher.'); - if (Error.captureStackTrace) { - Error.captureStackTrace(this); - } else { - this.stack = new Error().stack; - } - this.name = 'DisconnectedError'; -} - -/*! - * Inherits from MongooseError. - */ - -DisconnectedError.prototype = Object.create(MongooseError.prototype); -DisconnectedError.prototype.constructor = MongooseError; - - -/*! - * exports - */ - -module.exports = DisconnectedError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/divergentArray.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/divergentArray.js deleted file mode 100644 index 1cbaa25..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/divergentArray.js +++ /dev/null @@ -1,42 +0,0 @@ - -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/*! - * DivergentArrayError constructor. - * - * @inherits MongooseError - */ - -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 ' - + 'the _id field when the operation results in a $pop or $set of ' - + '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.'; - // 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. - */ - -DivergentArrayError.prototype = Object.create(MongooseError.prototype); -DivergentArrayError.prototype.constructor = MongooseError; - - -/*! - * exports - */ - -module.exports = DivergentArrayError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/messages.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/messages.js deleted file mode 100644 index 88ddf6e..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/messages.js +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * The default built-in validator error messages. These may be customized. - * - * // customize within each schema or globally like so - * var mongoose = require('mongoose'); - * mongoose.Error.messages.String.enum = "Your custom message for {PATH}."; - * - * As you might have noticed, error messages support basic templating - * - * - `{PATH}` is replaced with the invalid document path - * - `{VALUE}` is replaced with the invalid value - * - `{TYPE}` is replaced with the validator type such as "regexp", "min", or "user defined" - * - `{MIN}` is replaced with the declared min value for the Number.min validator - * - `{MAX}` is replaced with the declared max value for the Number.max validator - * - * Click the "show code" link below to see all defaults. - * - * @static messages - * @receiver MongooseError - * @api public - */ - -var msg = module.exports = exports = {}; - -msg.general = {}; -msg.general.default = 'Validator failed for path `{PATH}` with value `{VALUE}`'; -msg.general.required = 'Path `{PATH}` is required.'; - -msg.Number = {}; -msg.Number.min = 'Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).'; -msg.Number.max = 'Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).'; - -msg.Date = {}; -msg.Date.min = 'Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).'; -msg.Date.max = 'Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).'; - -msg.String = {}; -msg.String.enum = '`{VALUE}` is not a valid enum value for path `{PATH}`.'; -msg.String.match = 'Path `{PATH}` is invalid ({VALUE}).'; -msg.String.minlength = 'Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).'; -msg.String.maxlength = 'Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH}).'; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/missingSchema.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/missingSchema.js deleted file mode 100644 index 25eabfa..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/missingSchema.js +++ /dev/null @@ -1,33 +0,0 @@ - -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/*! - * MissingSchema Error constructor. - * - * @inherits MongooseError - */ - -function MissingSchemaError(name) { - var msg = 'Schema hasn\'t been registered for model "' + name + '".\n' - + 'Use mongoose.model(name, schema)'; - MongooseError.call(this, msg); - Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee); - this.name = 'MissingSchemaError'; -} - -/*! - * Inherits from MongooseError. - */ - -MissingSchemaError.prototype = Object.create(MongooseError.prototype); -MissingSchemaError.prototype.constructor = MongooseError; - -/*! - * exports - */ - -module.exports = MissingSchemaError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/objectExpected.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/objectExpected.js deleted file mode 100644 index fa863bc..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/objectExpected.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/** - * Strict mode error constructor - * - * @param {String} type - * @param {String} value - * @inherits MongooseError - * @api private - */ - -function ObjectExpectedError(path, val) { - MongooseError.call(this, 'Tried to set nested object field `' + path + - '` to primitive value `' + val + '` and strict mode is set to throw.'); - if (Error.captureStackTrace) { - Error.captureStackTrace(this); - } else { - this.stack = new Error().stack; - } - this.name = 'ObjectExpectedError'; - this.path = path; -} - -/*! - * Inherits from MongooseError. - */ - -ObjectExpectedError.prototype = Object.create(MongooseError.prototype); -ObjectExpectedError.prototype.constructor = MongooseError; - -module.exports = ObjectExpectedError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/overwriteModel.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/overwriteModel.js deleted file mode 100644 index c14ae7f..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/overwriteModel.js +++ /dev/null @@ -1,31 +0,0 @@ - -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/*! - * OverwriteModel Error constructor. - * - * @inherits MongooseError - */ - -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. - */ - -OverwriteModelError.prototype = Object.create(MongooseError.prototype); -OverwriteModelError.prototype.constructor = MongooseError; - -/*! - * exports - */ - -module.exports = OverwriteModelError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/strict.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/strict.js deleted file mode 100644 index 6e34431..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/strict.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * 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; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validation.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validation.js deleted file mode 100644 index e3322d4..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validation.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * Module requirements - */ - -var MongooseError = require('../error.js'); - -/** - * Document Validation Error - * - * @api private - * @param {Document} instance - * @inherits MongooseError - */ - -function ValidationError(instance) { - this.errors = {}; - if (instance && instance.constructor.name === 'model') { - MongooseError.call(this, instance.constructor.modelName + ' validation failed'); - } else { - MongooseError.call(this, 'Validation failed'); - } - if (Error.captureStackTrace) { - Error.captureStackTrace(this); - } else { - this.stack = new Error().stack; - } - this.name = 'ValidationError'; - if (instance) { - instance.errors = this.errors; - } -} - -/*! - * Inherits from MongooseError. - */ - -ValidationError.prototype = Object.create(MongooseError.prototype); -ValidationError.prototype.constructor = MongooseError; - - -/** - * Console.log helper - */ - -ValidationError.prototype.toString = function() { - var ret = this.name + ': '; - var msgs = []; - - Object.keys(this.errors || {}).forEach(function(key) { - if (this === this.errors[key]) { - return; - } - msgs.push(String(this.errors[key])); - }, this); - - return ret + msgs.join(', '); -}; - -/*! - * Module exports - */ - -module.exports = exports = ValidationError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validator.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validator.js deleted file mode 100644 index 96a3ba1..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/validator.js +++ /dev/null @@ -1,81 +0,0 @@ -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/** - * Schema validator error - * - * @param {Object} properties - * @inherits MongooseError - * @api private - */ - -function ValidatorError(properties) { - var msg = properties.message; - if (!msg) { - msg = MongooseError.messages.general.default; - } - - var message = this.formatMessage(msg, properties); - MongooseError.call(this, message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this); - } else { - this.stack = new Error().stack; - } - this.properties = properties; - this.name = 'ValidatorError'; - this.kind = properties.type; - this.path = properties.path; - this.value = properties.value; -} - -/*! - * Inherits from MongooseError - */ - -ValidatorError.prototype = Object.create(MongooseError.prototype); -ValidatorError.prototype.constructor = MongooseError; - -/*! - * The object used to define this validator. Not enumerable to hide - * it from `require('util').inspect()` output re: gh-3925 - */ - -Object.defineProperty(ValidatorError.prototype, 'properties', { - enumerable: false, - writable: true, - value: null -}); - -/*! - * Formats error messages - */ - -ValidatorError.prototype.formatMessage = function(msg, properties) { - var propertyNames = Object.keys(properties); - for (var i = 0; i < propertyNames.length; ++i) { - var propertyName = propertyNames[i]; - if (propertyName === 'message') { - continue; - } - msg = msg.replace('{' + propertyName.toUpperCase() + '}', properties[propertyName]); - } - return msg; -}; - -/*! - * toString helper - */ - -ValidatorError.prototype.toString = function() { - return this.message; -}; - -/*! - * exports - */ - -module.exports = ValidatorError; diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/version.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/version.js deleted file mode 100644 index e509b9b..0000000 --- a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/version.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -/*! - * Module dependencies. - */ - -var MongooseError = require('../error.js'); - -/** - * Version Error constructor. - * - * @inherits MongooseError - * @api private - */ - -function VersionError(doc) { - MongooseError.call(this, 'No matching document found for id "' + doc._id + - '"'); - this.name = 'VersionError'; -} - -/*! - * Inherits from MongooseError. - */ - -VersionError.prototype = Object.create(MongooseError.prototype); -VersionError.prototype.constructor = MongooseError; - -/*! - * exports - */ - -module.exports = VersionError; |