parallelValidate.js 561 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. /*!
  3. * Module dependencies.
  4. */
  5. const MongooseError = require('./mongooseError');
  6. class ParallelValidateError extends MongooseError {
  7. /**
  8. * ParallelValidate Error constructor.
  9. *
  10. * @param {Document} doc
  11. * @api private
  12. */
  13. constructor(doc) {
  14. const msg = 'Can\'t validate() the same doc multiple times in parallel. Document: ';
  15. super(msg + doc._id);
  16. }
  17. }
  18. Object.defineProperty(ParallelValidateError.prototype, 'name', {
  19. value: 'ParallelValidateError'
  20. });
  21. /*!
  22. * exports
  23. */
  24. module.exports = ParallelValidateError;