browserMissingSchema.js 681 B

12345678910111213141516171819202122232425262728293031323334
  1. /*!
  2. * Module dependencies.
  3. */
  4. var MongooseError = require('../error.js');
  5. /*!
  6. * MissingSchema Error constructor.
  7. *
  8. * @inherits MongooseError
  9. */
  10. function MissingSchemaError (name) {
  11. var msg = 'Schema hasn\'t been registered for document.\n'
  12. + 'Use mongoose.Document(name, schema)';
  13. MongooseError.call(this, msg);
  14. Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
  15. this.name = 'MissingSchemaError';
  16. }
  17. /*!
  18. * Inherits from MongooseError.
  19. */
  20. MissingSchemaError.prototype = Object.create(MongooseError.prototype);
  21. MissingSchemaError.prototype.constructor = MongooseError;
  22. /*!
  23. * exports
  24. */
  25. module.exports = MissingSchemaError;