disconnected.js 603 B

123456789101112131415161718192021222324252627282930313233
  1. /*!
  2. * Module dependencies.
  3. */
  4. 'use strict';
  5. const MongooseError = require('./');
  6. /**
  7. * The connection failed to reconnect and will never successfully reconnect to
  8. * MongoDB without manual intervention.
  9. * @api private
  10. */
  11. class DisconnectedError extends MongooseError {
  12. /**
  13. * @param {String} connectionString
  14. */
  15. constructor(id, fnName) {
  16. super('Connection ' + id +
  17. ' was disconnected when calling `' + fnName + '()`');
  18. }
  19. }
  20. Object.defineProperty(DisconnectedError.prototype, 'name', {
  21. value: 'DisconnectedError'
  22. });
  23. /*!
  24. * exports
  25. */
  26. module.exports = DisconnectedError;