(instance)
| 20 | class ValidationError extends MongooseError { |
| 21 | |
| 22 | constructor(instance) { |
| 23 | let _message; |
| 24 | if (getConstructorName(instance) === 'model') { |
| 25 | _message = instance.constructor.modelName + ' validation failed'; |
| 26 | } else { |
| 27 | _message = 'Validation failed'; |
| 28 | } |
| 29 | |
| 30 | super(_message); |
| 31 | |
| 32 | this.errors = {}; |
| 33 | this._message = _message; |
| 34 | |
| 35 | if (instance) { |
| 36 | instance.$errors = this.errors; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Console.log helper |
nothing calls this directly
no outgoing calls
no test coverage detected