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

Method constructor

lib/error/notFound.js:17–36  ·  view source on GitHub ↗
(filter, model, numAffected, result)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

inspectMethod · 0.45

Tested by

no test coverage detected