Skip to content

Commit

Permalink
handle wrong typed service config better
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Oct 24, 2023
1 parent daf9f63 commit a8892ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/myrobotlab/service/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,11 @@ synchronized private static Map<String, ServiceInterface> createServicesFromPlan
// process the base listeners/subscription of ServiceConfig
si.addConfigListeners(sc);
if (si instanceof ConfigurableService) {
try {
((ConfigurableService)si).apply(sc);
} catch(Exception e) {
Runtime.getInstance().error("could not apply config of type %s to service %s, using default config", sc.type, si.getName(), sc.type);
}
}
createdServices.put(service, si);
currentConfig.add(service);
Expand Down

0 comments on commit a8892ae

Please sign in to comment.