parallelSave.js 523 B

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