Properly propagate SQLException and VerifierException
getResultSetConverter() method can throw SQLException and
VerifierException. However, those exceptions will be wrapped in
an ExecutionException by the TimeLimiter. That may cause the verifier
run to fail completely instead of failing a single query (e.g., when
the query result set has more than maxRowCount rows).
@@ -49,6 +49,7 @@ import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
@@ -463,6 +464,16 @@ public class Validator
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
+ catch (ExecutionException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof SQLException) {
+ throw (SQLException) cause;
+ }
+ if (cause instanceof VerifierException) {
+ throw (VerifierException) cause;
+ }
+ throw Throwables.propagate(e);
+ }
catch (Exception e) {
throw Throwables.propagate(e);
}
