Files
Suggestion/node_modules/mongoose/lib/error/missingSchema.js
爱喝水的木子 00b48da363 fix
2026-03-02 15:35:39 +08:00

34 lines
561 B
JavaScript

/*!
* Module dependencies.
*/
'use strict';
const MongooseError = require('./mongooseError');
/**
* MissingSchema Error constructor.
* @param {String} name
* @api private
*/
class MissingSchemaError extends MongooseError {
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;