Github user afs commented on a diff in the pull request:
https://github.com/apache/jena/pull/315#discussion_r153043716
--- Diff:
jena-arq/src/main/java/org/apache/jena/riot/system/ErrorHandlerFactory.java ---
@@ -221,6 +224,64 @@ public void fatal(String message, long line, long col)
{
}
}
+ /** An error handler that logs message for errors and warnings and
throw exceptions on either */
+ public static class ErrorHandlerTracking extends ErrorLogger
implements ErrorHandler {
+ private final boolean failOnError, failOnWarning;
+ private long errorCount, warningCount;
+
+ public ErrorHandlerTracking(Logger log, boolean failOnError,
boolean failOnWarning) {
--- End diff --
Suggestion: `ErrorHandlerTracking` wraps another `ErrorHandler` as argument
and forwards all warning/error/fatal calls to that error handler after
incrementing its counters. This makes the choice of how to respond to warning
or error dependent on the argument `ErrorHandler`.
---