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

Method addError

lib/error/setOptionError.js:45–57  ·  view source on GitHub ↗

* add message * @param {String} key * @param {String|Error} error * @api private

(key, error)

Source from the content-addressed store, hash-verified

43 * @api private
44 */
45 addError(key, error) {
46 if (error instanceof SetOptionError) {
47 const { errors } = error;
48 for (const optionKey of Object.keys(errors)) {
49 this.addError(optionKey, errors[optionKey]);
50 }
51
52 return;
53 }
54
55 this.errors[key] = error;
56 this.message = combinePathErrors(this);
57 }
58}
59
60

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected