wrap checked exception

This commit is contained in:
Jonathan Shook 2024-09-11 15:34:01 -05:00
parent 09c457ed8c
commit cb02fd9f01

View File

@ -27,6 +27,7 @@ import io.nosqlbench.adapters.api.activityimpl.BaseOpDispenser;
import io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter;
import io.nosqlbench.adapters.api.templating.ParsedOp;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.v1.auth.exception.AuthException;
public abstract class WeaviateBaseOpDispenser<T> extends BaseOpDispenser<WeaviateBaseOp<T>, WeaviateSpace> {
@ -38,7 +39,13 @@ public abstract class WeaviateBaseOpDispenser<T> extends BaseOpDispenser<Weaviat
protected WeaviateBaseOpDispenser(WeaviateDriverAdapter adapter, ParsedOp op, LongFunction<String> targetF) {
super((DriverAdapter) adapter, op);
this.weaviateSpaceFunction = adapter.getSpaceFunc(op);
this.clientFunction = (long l) -> this.weaviateSpaceFunction.apply(l).getClient();
this.clientFunction = (long l) -> {
try {
return this.weaviateSpaceFunction.apply(l).getClient();
} catch (AuthException e) {
throw new RuntimeException(e);
}
};
this.paramF = getParamFunc(this.clientFunction, op, targetF);
this.opF = createOpFunc(paramF, this.clientFunction, op, targetF);
}