diff options
author | YuanHu <yuan.hu1@zte.com.cn> | 2016-12-01 16:12:46 +0800 |
---|---|---|
committer | YuanHu <yuan.hu1@zte.com.cn> | 2016-12-01 16:17:17 +0800 |
commit | 8c4e3f27fbc8df5cfa8a0dd3c9b4e04dfaa36799 (patch) | |
tree | f42a9f13b1f321a299edab9df6ca9cb338438d3e /catalog-core | |
parent | fe2b8d5a4c201b32d016ecb5930e197d3fb84e0a (diff) |
Add response information of wso2 to exception, while deploy/undeploy failed.
Change-Id: I4e2ca7db63d3df645d629a71583d64ffe96434f0
Issue-id: TOSCA-191
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'catalog-core')
4 files changed, 25 insertions, 6 deletions
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 + "]"; + } } |