Skip to content

Commit a7888eb

Browse files
authored
Inadequate error reporting from ChildLoader (#548)
2 parents 7b97bd8 + bc0b42f commit a7888eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/cloudbees/hudson/plugins/folder/ChildLoader.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ public <V extends TopLevelItem> V loadItem(AbstractFolder<V> parent, File subdir
9191
item.onLoad(parent, name);
9292
return item;
9393
} catch (Exception e) {
94-
LOGGER.warning(() -> "could not load " + subdir + " due to " + e);
95-
LOGGER.log(Level.FINE, null, e);
94+
if (e instanceof FileNotFoundException && !LOGGER.isLoggable(Level.FINE)) {
95+
// commonplace error from missing config.xml, avoid log spam unless FINE is enabled anyway
96+
LOGGER.warning(() -> "could not load " + subdir + " due to " + e);
97+
} else {
98+
LOGGER.log(Level.WARNING, "could not load " + subdir, e);
99+
}
96100
return null;
97101
}
98102
}

0 commit comments

Comments
 (0)