From 8c4e3f27fbc8df5cfa8a0dd3c9b4e04dfaa36799 Mon Sep 17 00:00:00 2001 From: YuanHu Date: Thu, 1 Dec 2016 16:12:46 +0800 Subject: Add response information of wso2 to exception, while deploy/undeploy failed. Change-Id: I4e2ca7db63d3df645d629a71583d64ffe96434f0 Issue-id: TOSCA-191 Signed-off-by: YuanHu --- .../catalog/model/plan/wso2/Wso2ServiceConsumer.java | 12 ++++++------ .../model/plan/wso2/entity/DeletePackageResponse.java | 6 ++++++ .../model/plan/wso2/entity/DeployPackageResponse.java | 7 +++++++ .../catalog/model/plan/wso2/entity/StartProcessResponse.java | 6 ++++++ 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'catalog-core') diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java index 03f894ea..1d753744 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java @@ -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); } } diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java index b5006e14..c3b04092 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java @@ -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 + "]"; + } } diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java index c407d445..d106b89d 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java @@ -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 + "]"; + } + } diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java index 1e550660..7e01e770 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java @@ -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 + "]"; + } } -- cgit 1.2.3-korg