Browse Source

AMBARI-3846. Nagios alerts when returning bad json breaks the UI really badly. (swagle)

Siddharth Wagle 11 năm trước cách đây
mục cha
commit
071c9d4711

+ 4 - 0
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpProxyPropertyProvider.java

@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import com.google.gson.JsonSyntaxException;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.PropertyProvider;
@@ -136,6 +137,9 @@ public class HttpProxyPropertyProvider extends BaseProvider implements PropertyP
     catch (IOException ioe) {
       LOG.error("Error reading HTTP response from " + url);
       r.setProperty(propertyIdToSet, null);
+    } catch (JsonSyntaxException jse) {
+      LOG.error("Error parsing HTTP response from " + url);
+      r.setProperty(propertyIdToSet, null);
     } finally {
       if (in != null) {
         try {