Add response information of wso2 to exception, while deploy/undeploy failed.
authorYuanHu <yuan.hu1@zte.com.cn>
Thu, 1 Dec 2016 08:12:46 +0000 (16:12 +0800)
committerYuanHu <yuan.hu1@zte.com.cn>
Thu, 1 Dec 2016 08:17:17 +0000 (16:17 +0800)
Change-Id: I4e2ca7db63d3df645d629a71583d64ffe96434f0
Issue-id: TOSCA-191
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java
catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java
catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java
catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java

index 03f894e..1d75374 100644 (file)
@@ -179,10 +179,10 @@ public class Wso2ServiceConsumer {
       if (response.isSuccess()) {
         return response;
       }
-      throw new CatalogResourceException(response.getException());
-    } catch (Exception e1) {
+      throw new CatalogResourceException(response.toString());
+    } catch (Exception e) {
       throw new CatalogResourceException(
-          "Call Delete Package api failed. packageName = " + packageName, e1);
+          "Call Delete Package api failed. packageName = " + packageName, e);
     }
   }
 
@@ -205,9 +205,9 @@ public class Wso2ServiceConsumer {
       if (response.isSuccess()) {
         return response;
       }
-      throw new CatalogResourceException(response.getException());
-    } catch (Exception e1) {
-      throw new CatalogResourceException("Call Start Process api failed.", e1);
+      throw new CatalogResourceException(response.toString());
+    } catch (Exception e) {
+      throw new CatalogResourceException("Call Start Process api failed.", e);
     }
   }
 
index b5006e1..c3b0409 100644 (file)
@@ -36,4 +36,10 @@ public class DeletePackageResponse {
   public boolean isSuccess() {
     return this.status == STATUS_SUCCESS;
   }
+
+  @Override
+  public String toString() {
+    return "DeletePackageResponse [status=" + status + ", message=" + message + ", exception="
+        + exception + "]";
+  }
 }
index c407d44..d106b89 100644 (file)
@@ -38,4 +38,11 @@ public class DeployPackageResponse {
   public boolean isSuccess() {
     return this.status == STATUS_SUCCESS;
   }
+
+  @Override
+  public String toString() {
+    return "DeployPackageResponse [status=" + status + ", message=" + message + ", packageName="
+        + packageName + ", processId=" + processId + ", exception=" + exception + "]";
+  }
+  
 }
index 1e55066..7e01e77 100644 (file)
@@ -37,4 +37,10 @@ public class StartProcessResponse {
   public boolean isSuccess() {
     return this.status == STATUS_SUCCESS;
   }
+
+  @Override
+  public String toString() {
+    return "StartProcessResponse [status=" + status + ", message=" + message + ", response="
+        + response + ", exception=" + exception + "]";
+  }
 }