mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Catch ISE if config admin is no longer available (#3949)
This commit is contained in:
+7
-4
@@ -12,9 +12,7 @@
|
||||
*/
|
||||
package org.openhab.core.config.discovery.addon;
|
||||
|
||||
import static org.openhab.core.config.discovery.addon.AddonFinderConstants.SUGGESTION_FINDERS;
|
||||
import static org.openhab.core.config.discovery.addon.AddonFinderConstants.SUGGESTION_FINDER_CONFIGS;
|
||||
import static org.openhab.core.config.discovery.addon.AddonFinderConstants.SUGGESTION_FINDER_FEATURES;
|
||||
import static org.openhab.core.config.discovery.addon.AddonFinderConstants.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -50,6 +48,8 @@ import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.service.component.annotations.ReferencePolicy;
|
||||
import org.osgi.service.component.annotations.ReferencePolicyOption;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* This is a {@link AddonSuggestionService} which discovers suggested add-ons for the user to install.
|
||||
@@ -64,6 +64,8 @@ public class AddonSuggestionService implements AutoCloseable {
|
||||
public static final String SERVICE_NAME = "addon-suggestion-service";
|
||||
public static final String CONFIG_PID = "org.openhab.addons";
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(AddonSuggestionService.class);
|
||||
|
||||
private final Set<AddonInfoProvider> addonInfoProviders = ConcurrentHashMap.newKeySet();
|
||||
private final List<AddonFinder> addonFinders = Collections.synchronizedList(new ArrayList<>());
|
||||
private final ConfigurationAdmin configurationAdmin;
|
||||
@@ -148,7 +150,8 @@ public class AddonSuggestionService implements AutoCloseable {
|
||||
if (!cfgMap.equals(config)) {
|
||||
modified(cfgMap);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | IllegalStateException e) {
|
||||
logger.debug("Exception occurred while trying to sync the configuration: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user