Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jshook committed Mar 22, 2024
1 parent df702d7 commit 4623f09
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,19 @@ public StandardActivity(NBComponent parent, ActivityDef activityDef) {
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());
Expand Down

0 comments on commit 4623f09

Please sign in to comment.