* add message * @param {string} path * @param {string|Error} error * @api private
(path, error)
| 51 | * @api private |
| 52 | */ |
| 53 | addError(path, error) { |
| 54 | if (error instanceof ValidationError) { |
| 55 | const { errors } = error; |
| 56 | for (const errorPath of Object.keys(errors)) { |
| 57 | this.addError(`${path}.${errorPath}`, errors[errorPath]); |
| 58 | } |
| 59 | |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | this.errors[path] = error; |
| 64 | this.message = this._message + ': ' + combinePathErrors(this); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 |
no outgoing calls
no test coverage detected