/node_modules/mongoose/lib/error/disconnected.js

https://bitbucket.org/coleman333/smartsite · JavaScript · 40 lines · 15 code · 8 blank · 17 comment · 2 complexity · f3d26b29e54d3c45fbb5c81e40bc59c4 MD5 · raw file

  1. /*!
  2. * Module dependencies.
  3. */
  4. var MongooseError = require('./');
  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. this.name = 'DisconnectedError';
  18. if (Error.captureStackTrace) {
  19. Error.captureStackTrace(this);
  20. } else {
  21. this.stack = new Error().stack;
  22. }
  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;