disconnected.js 709 B

12345678910111213141516171819202122232425262728293031323334
  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(connectionString) {
  16. super('Ran out of retries trying to reconnect to "' +
  17. connectionString + '". Try setting `server.reconnectTries` and ' +
  18. '`server.reconnectInterval` to something higher.');
  19. }
  20. }
  21. Object.defineProperty(DisconnectedError.prototype, 'name', {
  22. value: 'DisconnectedError'
  23. });
  24. /*!
  25. * exports
  26. */
  27. module.exports = DisconnectedError;