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: commits-unsubscr...@ambari.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@ambari.apache.org
For additional commands, e-mail: commits-h...@ambari.apache.org

Reply via email to