parallelValidate.js 556 B

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