arnaucube
arnaucube/thoughtsPublic Self-hosted repository
thoughts/node_modules/mongoose/lib/error/missingSchema.js
node_modules/mongoose/lib/error/missingSchema.jsRaw
 1
 2/*!
 3 * Module dependencies.
 4 */
 5
 6var MongooseError = require('../error.js');
 7
 8/*!
 9 * MissingSchema Error constructor.
10 *
11 * @inherits MongooseError
12 */
13
14function MissingSchemaError(name) {
15  var msg = 'Schema hasn\'t been registered for model "' + name + '".\n'
16          + 'Use mongoose.model(name, schema)';
17  MongooseError.call(this, msg);
18  Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
19  this.name = 'MissingSchemaError';
20}
21
22/*!
23 * Inherits from MongooseError.
24 */
25
26MissingSchemaError.prototype = Object.create(MongooseError.prototype);
27MissingSchemaError.prototype.constructor = MongooseError;
28
29/*!
30 * exports
31 */
32
33module.exports = MissingSchemaError;