overwriteModel.js 468 B

1234567891011121314151617181920212223242526272829
  1. /*!
  2. * Module dependencies.
  3. */
  4. 'use strict';
  5. const MongooseError = require('./');
  6. class OverwriteModelError extends MongooseError {
  7. /*!
  8. * OverwriteModel Error constructor.
  9. * @param {String} name
  10. */
  11. constructor(name) {
  12. super('Cannot overwrite `' + name + '` model once compiled.');
  13. }
  14. }
  15. Object.defineProperty(OverwriteModelError.prototype, 'name', {
  16. value: 'OverwriteModelError'
  17. });
  18. /*!
  19. * exports
  20. */
  21. module.exports = OverwriteModelError;