diff --git a/driver-http/src/main/java/io/nosqlbench/activitytype/http/InvalidStatusCodeException.java b/driver-http/src/main/java/io/nosqlbench/activitytype/http/InvalidStatusCodeException.java index e13c5986c..85d957570 100644 --- a/driver-http/src/main/java/io/nosqlbench/activitytype/http/InvalidStatusCodeException.java +++ b/driver-http/src/main/java/io/nosqlbench/activitytype/http/InvalidStatusCodeException.java @@ -7,6 +7,11 @@ public class InvalidStatusCodeException extends RuntimeException { private final Pattern ok_status; private final int statusCode; + @Override + public String getMessage() { + return "Server returned status code '" + statusCode + "' which did not match ok_status '" + ok_status.toString() + "'"; + } + public InvalidStatusCodeException(long cycleValue, Pattern ok_status, int statusCode) { this.cycleValue = cycleValue; this.ok_status = ok_status; diff --git a/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/errorhandling/modular/handlers/StopErrorHandler.java b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/errorhandling/modular/handlers/StopErrorHandler.java index 1724398ea..394224d6f 100644 --- a/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/errorhandling/modular/handlers/StopErrorHandler.java +++ b/engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/errorhandling/modular/handlers/StopErrorHandler.java @@ -13,9 +13,6 @@ public class StopErrorHandler implements ErrorHandler { @Override public ErrorDetail handleError(Throwable t, long cycle, long durationInNanos, ErrorDetail detail) { - String durationSummary = String.format("%.3fS", ((double) durationInNanos / 1000000000.0)); - throw new RuntimeException( - "An error was rethrown in order to stop the activity in cycle:" + cycle + ", duration:" + durationSummary + " msg:" + - t.getMessage()); + throw new RuntimeException(t); } }