Contract interface that all error reporters must implement. Error reporters are responsible for collecting validation errors and formatting them into appropriate error objects.
class CustomErrorReporter implements ErrorReporterContract { report(message: string, rule: string, field: FieldContext) { // Custom error reporting logic } createError(): ValidationError { return new ValidationError(this.getErrors()) }} Copy
class CustomErrorReporter implements ErrorReporterContract { report(message: string, rule: string, field: FieldContext) { // Custom error reporting logic } createError(): ValidationError { return new ValidationError(this.getErrors()) }}
Creates a ValidationError instance from collected errors. Called after all validation errors have been reported.
Contract interface that all error reporters must implement. Error reporters are responsible for collecting validation errors and formatting them into appropriate error objects.
Example