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