Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ public String getText() {
}

public static LogFeederMode fromString(String text) {
for (LogFeederMode mode : LogFeederMode.values()) {
if (mode.text.equalsIgnoreCase(text)) {
return mode;
try {
for (LogFeederMode mode : LogFeederMode.values()) {
if (mode.text.equalsIgnoreCase(text)) {
return mode;
}
}
} catch (IllegalArgumentException e) {
return LogFeederMode.DEFAULT;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rzuo Can we add some logging here to indicate this configuration exception and the fallback to using the default configuration? This would help users troubleshoot issues more easily.

}
throw new IllegalArgumentException(String.format("String '%s' cannot be converted to LogFeederMode enum", text));
return LogFeederMode.DEFAULT;
}

public static boolean isCloudStorage(LogFeederMode mode) {
Expand Down