Skip to content

Commit

Permalink
fix: log YAML parsing errors as warning to avoid popup
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Dec 18, 2023
1 parent b284bfa commit b209dde
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ protected final T getConfig() {
try (InputStream input = configFile.getInputStream()) {
config = loadConfig(input);
lastModified = configFile.getModificationStamp();
} catch (IOException e) {
} catch (Exception e) {
reset();
LOGGER.error("Error while loading properties from '" + configFile + "'.", e);
LOGGER.warn("Error while loading properties from '" + configFile + "'.", e);
}
}
} catch (RuntimeException e1) {
LOGGER.error("Error while getting last modified time for '" + configFile + "'.", e1);
LOGGER.warn("Error while getting last modified time for '" + configFile + "'.", e1);
}
return config;
}
Expand All @@ -194,9 +194,9 @@ public void reload(PsiFile file) {
try (InputStream input = IOUtils.toInputStream(content, Charset.defaultCharset())) {
config = loadConfig(input);
lastModified = System.currentTimeMillis();
} catch (IOException e) {
} catch (Exception e) {
reset();
LOGGER.error("Error while loading properties from '" + sourceConfigFile + "'.", e);
LOGGER.warn("Error while loading properties from '" + sourceConfigFile + "'.", e);
}
}

Expand All @@ -207,7 +207,7 @@ public Integer getPropertyAsInt(String key) {
try {
return Integer.parseInt(property.trim());
} catch (NumberFormatException e) {
LOGGER.error("Error while converting '" + property.trim() + "' as Integer for key '" + key + "'", e);
LOGGER.warn("Error while converting '" + property.trim() + "' as Integer for key '" + key + "'", e);
return null;
}
}
Expand Down

0 comments on commit b209dde

Please sign in to comment.