MCPcopy Create free account
hub / github.com/Automattic/mongoose / constructor

Method constructor

lib/error/notFound.js:15–34  ·  view source on GitHub ↗

* OverwriteModel Error constructor. * @api private

(filter, model, numAffected, result)

Source from the content-addressed store, hash-verified

13 * @api private
14 */
15 constructor(filter, model, numAffected, result) {
16 let msg;
17 const messages = MongooseError.messages;
18 if (messages.DocumentNotFoundError != null) {
19 msg = typeof messages.DocumentNotFoundError === 'function' ?
20 messages.DocumentNotFoundError(filter, model) :
21 messages.DocumentNotFoundError;
22 } else {
23 msg = 'No document found for query "' + util.inspect(filter) +
24 '" on model "' + model + '"';
25 }
26
27 super(msg);
28
29 this.result = result;
30 this.numAffected = numAffected;
31 this.filter = filter;
32 // Backwards compat
33 this.query = filter;
34 }
35}
36
37Object.defineProperty(DocumentNotFoundError.prototype, 'name', {

Callers

nothing calls this directly

Calls 1

inspectMethod · 0.45

Tested by

no test coverage detected