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

Function DocumentNotFoundError

lib/error/notFound.js:16–37  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

14 */
15
16function DocumentNotFoundError(query) {
17 var msg;
18 var messages = MongooseError.messages;
19 if (messages.DocumentNotFoundError != null) {
20 msg = typeof messages.DocumentNotFoundError === 'function' ?
21 messages.DocumentNotFoundError(query) :
22 messages.DocumentNotFoundError;
23 } else {
24 msg = 'No document found for query "' + util.inspect(query) + '"';
25 }
26
27 MongooseError.call(this, msg);
28
29 this.name = 'DocumentNotFoundError';
30 if (Error.captureStackTrace) {
31 Error.captureStackTrace(this);
32 } else {
33 this.stack = new Error().stack;
34 }
35
36 this.query = query;
37}
38
39/*!
40 * Inherits from MongooseError.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected