UNPKG

709 BJavaScriptView Raw
1/*!
2 * Module dependencies.
3 */
4
5'use strict';
6
7const MongooseError = require('./');
8
9
10/**
11 * The connection failed to reconnect and will never successfully reconnect to
12 * MongoDB without manual intervention.
13 * @api private
14 */
15class DisconnectedError extends MongooseError {
16 /**
17 * @param {String} connectionString
18 */
19 constructor(connectionString) {
20 super('Ran out of retries trying to reconnect to "' +
21 connectionString + '". Try setting `server.reconnectTries` and ' +
22 '`server.reconnectInterval` to something higher.');
23 }
24}
25
26Object.defineProperty(DisconnectedError.prototype, 'name', {
27 value: 'DisconnectedError'
28});
29
30/*!
31 * exports
32 */
33
34module.exports = DisconnectedError;