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

Method constructor

lib/error/validator.js:18–33  ·  view source on GitHub ↗

* Schema validator error * * @param {Object} properties * @param {Document} doc * @api private

(properties, doc)

Source from the content-addressed store, hash-verified

16 * @api private
17 */
18 constructor(properties, doc) {
19 let msg = properties.message;
20 if (!msg) {
21 msg = MongooseError.messages.general.default;
22 }
23
24 const message = formatMessage(msg, properties, doc);
25 super(message);
26
27 properties = Object.assign({}, properties, { message: message });
28 this.properties = properties;
29 this.kind = properties.type;
30 this.path = properties.path;
31 this.value = properties.value;
32 this.reason = properties.reason;
33 }
34
35 /**
36 * toString helper

Callers

nothing calls this directly

Calls 1

formatMessageFunction · 0.70

Tested by

no test coverage detected