From 126dce265f2ec678f40a5d4fe54bcfd234fcc8ec Mon Sep 17 00:00:00 2001 From: Percy Baker Date: Mon, 19 Oct 2026 14:12:13 +0100 Subject: [PATCH] Start and log error (rather than refusing to start) if -settings flag points to nonexistent file --- .../src/main/java/org/phoebus/product/Launcher.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/launcher/src/main/java/org/phoebus/product/Launcher.java b/core/launcher/src/main/java/org/phoebus/product/Launcher.java index 05b9bd88e1..58d145d1c2 100644 --- a/core/launcher/src/main/java/org/phoebus/product/Launcher.java +++ b/core/launcher/src/main/java/org/phoebus/product/Launcher.java @@ -140,10 +140,15 @@ public static void main(final String[] original_args) throws Exception { iter.remove(); logger.info("Loading settings from " + location); - if (location.endsWith(".xml")) - Preferences.importPreferences(new FileInputStream(location)); - else - PropertyPreferenceLoader.load(location); + try { + if (location.endsWith(".xml")) + Preferences.importPreferences(new FileInputStream(location)); + else + PropertyPreferenceLoader.load(location); + } catch (Exception e) { + logger.severe("Failed to load settings from " + location); + e.printStackTrace(); + } } else if (cmd.equals("-export_settings")) { if (!iter.hasNext())