missingSchema.js 538 B

123456789101112131415161718192021222324252627282930
  1. /*!
  2. * Module dependencies.
  3. */
  4. 'use strict';
  5. const MongooseError = require('./');
  6. class MissingSchemaError extends MongooseError {
  7. /*!
  8. * MissingSchema Error constructor.
  9. * @param {String} name
  10. */
  11. constructor(name) {
  12. const msg = 'Schema hasn\'t been registered for model "' + name + '".\n'
  13. + 'Use mongoose.model(name, schema)';
  14. super(msg);
  15. }
  16. }
  17. Object.defineProperty(MissingSchemaError.prototype, 'name', {
  18. value: 'MissingSchemaError'
  19. });
  20. /*!
  21. * exports
  22. */
  23. module.exports = MissingSchemaError;