File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/config Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,12 @@ protected void configurePropertySources(Optional<String> cmdLineArgs) {
211211 currentSources .forEach (ps -> propsList .remove (ps .getName ()));
212212 fallbackSources .forEach (ps -> propsList .addLast (ps ));
213213
214- currentConfig = loadAndValidateFromProperties (INSPECTIT_ROOT_PREFIX , InspectitConfig .class ).get ();
214+ Optional <InspectitConfig > fallbackConfig = loadAndValidateFromProperties (INSPECTIT_ROOT_PREFIX , InspectitConfig .class );
215+ if (fallbackConfig .isPresent ()) {
216+ currentConfig = fallbackConfig .get ();
217+ } else {
218+ throw new RuntimeException ("The fallback configuration could not be parsed, probably due to a validation error. See logs for further information." );
219+ }
215220
216221 fallbackSources .forEach (ps -> propsList .remove (ps .getName ()));
217222 currentSources .forEach (ps -> propsList .addLast (ps ));
You can’t perform that action at this time.
0 commit comments