瀏覽代碼

AMBARI-13080. Log a WARN/ERROR when invalid blueprint is POST'ed (smohanty)

Sumit Mohanty 10 年之前
父節點
當前提交
eb36305a34

+ 6 - 1
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java

@@ -150,7 +150,12 @@ public class BlueprintResourceProvider extends AbstractControllerResourceProvide
              ResourceAlreadyExistsException, NoSuchParentResourceException {
 
     for (Map<String, Object> properties : request.getProperties()) {
-      createResources(getCreateCommand(properties, request.getRequestInfoProperties()));
+      try {
+        createResources(getCreateCommand(properties, request.getRequestInfoProperties()));
+      }catch(IllegalArgumentException e) {
+        LOG.error("Exception while creating blueprint", e);
+        throw e;
+      }
     }
     notifyCreate(Resource.Type.Blueprint, request);