better error message

This commit is contained in:
Jonathan Shook
2024-03-22 09:56:16 -05:00
parent df702d7d6a
commit 4623f09d6f

View File

@@ -112,8 +112,19 @@ public class StandardActivity<R extends Op, S> extends SimpleActivity implements
if (!adapters.containsKey(driverName)) {
DriverAdapter<?,?> adapter = Optional.of(driverName)
.flatMap(name -> ServiceSelector.of(name,ServiceLoader.load(DriverAdapterLoader.class)).get())
.map(l -> l.load(this,NBLabels.forKV())).orElseThrow();
.flatMap(
name -> ServiceSelector.of(
name,
ServiceLoader.load(DriverAdapterLoader.class)
)
.get())
.map(
l -> l.load(
this,
NBLabels.forKV()
)
)
.orElseThrow(() -> new OpConfigError("driver adapter not present for name '" + driverName + "'"));
NBConfigModel combinedModel = yamlmodel;
NBConfiguration combinedConfig = combinedModel.matchConfig(activityDef.getParams());