You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1023 B

  1. /**
  2. * MongooseError constructor
  3. *
  4. * @param {String} msg Error message
  5. * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error
  6. */
  7. function MongooseError (msg) {
  8. Error.call(this);
  9. Error.captureStackTrace(this, arguments.callee);
  10. this.message = msg;
  11. this.name = 'MongooseError';
  12. };
  13. /*!
  14. * Inherits from Error.
  15. */
  16. MongooseError.prototype.__proto__ = Error.prototype;
  17. /*!
  18. * Module exports.
  19. */
  20. module.exports = exports = MongooseError;
  21. /*!
  22. * Expose subclasses
  23. */
  24. MongooseError.CastError = require('./errors/cast');
  25. MongooseError.DocumentError = require('./errors/document');
  26. MongooseError.ValidationError = require('./errors/validation')
  27. MongooseError.ValidatorError = require('./errors/validator')
  28. MongooseError.VersionError =require('./errors/version')
  29. MongooseError.OverwriteModelError = require('./errors/overwriteModel')
  30. MongooseError.MissingSchemaError = require('./errors/missingSchema')
  31. MongooseError.DivergentArrayError = require('./errors/divergentArray')