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

Method addError

lib/error/setOptionError.js:47–59  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected