* If a thing like `err` has not already been emitted, emit * code DocutilsValidator.FAILURE. * @param err A validation error * @returns
(err: DocutilsError | string)
| 185 | * @returns |
| 186 | */ |
| 187 | protected fail(err: DocutilsError | string) { |
| 188 | const dErr = typeof err === 'string' ? new DocutilsError(err) : err; |
| 189 | if (!this.emittedErrors.has(dErr.message)) { |
| 190 | this.emit(DocutilsValidator.FAILURE, dErr); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Emits a {@linkcode DocutilsValidator.SUCCESS} event |