summaryrefslogtreecommitdiffstats
path: root/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/lib/error/disconnected.js
blob: b4eece1cac1a30427734d217f1d5e2efcbae22d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*!
 * Module dependencies.
 */

var MongooseError = require('../error.js');

/**
 * Casting Error constructor.
 *
 * @param {String} type
 * @param {String} value
 * @inherits MongooseError
 * @api private
 */

function DisconnectedError(connectionString) {
  MongooseError.call(this, 'Ran out of retries trying to reconnect to "' +
    connectionString + '". Try setting `server.reconnectTries` and ' +
    '`server.reconnectInterval` to something higher.');
  if (Error.captureStackTrace) {
    Error.captureStackTrace(this);
  } else {
    this.stack = new Error().stack;
  }
  this.name = 'DisconnectedError';
}

/*!
 * Inherits from MongooseError.
 */

DisconnectedError.prototype = Object.create(MongooseError.prototype);
DisconnectedError.prototype.constructor = MongooseError;


/*!
 * exports
 */

module.exports = DisconnectedError;