JiaLiangC commented on code in PR #98:
URL: https://github.com/apache/ambari-logsearch/pull/98#discussion_r1693813012
##########
ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederMode.java:
##########
@@ -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;
Review Comment:
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]