You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
556 B
JavaScript
32 lines
556 B
JavaScript
1 year ago
|
|
||
|
/*!
|
||
|
* Module dependencies.
|
||
|
*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
const MongooseError = require('./');
|
||
|
|
||
|
class MissingSchemaError extends MongooseError {
|
||
|
/**
|
||
|
* MissingSchema Error constructor.
|
||
|
* @param {String} name
|
||
|
* @api private
|
||
|
*/
|
||
|
constructor(name) {
|
||
|
const msg = 'Schema hasn\'t been registered for model "' + name + '".\n'
|
||
|
+ 'Use mongoose.model(name, schema)';
|
||
|
super(msg);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Object.defineProperty(MissingSchemaError.prototype, 'name', {
|
||
|
value: 'MissingSchemaError'
|
||
|
});
|
||
|
|
||
|
/*!
|
||
|
* exports
|
||
|
*/
|
||
|
|
||
|
module.exports = MissingSchemaError;
|