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

Method constructor

lib/error/validator.js:19–34  ·  view source on GitHub ↗
(properties, doc)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

formatMessageFunction · 0.70

Tested by

no test coverage detected