({errors, project, yaml})
| 12 | */ |
| 13 | class ValidationError extends Error { |
| 14 | constructor({errors, project, yaml}) { |
| 15 | super(); |
| 16 | |
| 17 | /** |
| 18 | * ValidationError |
| 19 | * |
| 20 | * @constant |
| 21 | * @default |
| 22 | * @type {string} |
| 23 | * @readonly |
| 24 | * @public |
| 25 | */ |
| 26 | this.name = "ValidationError"; |
| 27 | |
| 28 | this.project = project; |
| 29 | this.yaml = yaml; |
| 30 | |
| 31 | this.errors = ValidationError.filterErrors(errors); |
| 32 | |
| 33 | /** |
| 34 | * Formatted error message |
| 35 | * |
| 36 | * @type {string} |
| 37 | * @readonly |
| 38 | * @public |
| 39 | */ |
| 40 | this.message = this.formatErrors(); |
| 41 | |
| 42 | Error.captureStackTrace(this, this.constructor); |
| 43 | } |
| 44 | |
| 45 | formatErrors() { |
| 46 | let separator = "\n\n"; |
nothing calls this directly
no test coverage detected