From a8892ae9303f7f99df3d1e5bb5818f3dd45bb226 Mon Sep 17 00:00:00 2001 From: grog Date: Tue, 24 Oct 2023 06:05:13 -0700 Subject: [PATCH] handle wrong typed service config better --- src/main/java/org/myrobotlab/service/Runtime.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/myrobotlab/service/Runtime.java b/src/main/java/org/myrobotlab/service/Runtime.java index 9a385bcd7d..e17cd987b9 100644 --- a/src/main/java/org/myrobotlab/service/Runtime.java +++ b/src/main/java/org/myrobotlab/service/Runtime.java @@ -443,7 +443,11 @@ synchronized private static Map 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);