You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
844 B

  1. /*!
  2. * Module dependencies.
  3. */
  4. var MongooseError = require('../error.js');
  5. /**
  6. * Casting Error constructor.
  7. *
  8. * @param {String} type
  9. * @param {String} value
  10. * @inherits MongooseError
  11. * @api private
  12. */
  13. function DisconnectedError(connectionString) {
  14. MongooseError.call(this, 'Ran out of retries trying to reconnect to "' +
  15. connectionString + '". Try setting `server.reconnectTries` and ' +
  16. '`server.reconnectInterval` to something higher.');
  17. if (Error.captureStackTrace) {
  18. Error.captureStackTrace(this);
  19. } else {
  20. this.stack = new Error().stack;
  21. }
  22. this.name = 'DisconnectedError';
  23. }
  24. /*!
  25. * Inherits from MongooseError.
  26. */
  27. DisconnectedError.prototype = Object.create(MongooseError.prototype);
  28. DisconnectedError.prototype.constructor = MongooseError;
  29. /*!
  30. * exports
  31. */
  32. module.exports = DisconnectedError;