PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 5var MongooseError = require('./');
 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  this.name = 'DisconnectedError';
21  if (Error.captureStackTrace) {
22    Error.captureStackTrace(this);
23  } else {
24    this.stack = new Error().stack;
25  }
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;