Fixed issues found when deploying a non existing application
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ad2afd09 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ad2afd09 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ad2afd09 Branch: refs/heads/master Commit: ad2afd0943288ecf65481f1380ce3af142ab77f4 Parents: 3e12693 Author: Dinithi <[email protected]> Authored: Wed May 20 11:05:50 2015 +0530 Committer: Dinithi <[email protected]> Committed: Wed May 20 11:05:50 2015 +0530 ---------------------------------------------------------------------- .../org/apache/stratos/cli/RestCommandLineService.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/ad2afd09/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java index edca089..d430572 100644 --- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java +++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java @@ -1525,18 +1525,11 @@ public class RestCommandLineService { HttpResponse response = restClient.doPost(httpClient, restClient.getBaseURL() + url, ""); - String responseCode = "" + response.getStatusLine().getStatusCode(); + String result = getHttpResponseString(response); GsonBuilder gsonBuilder = new GsonBuilder(); Gson gson = gsonBuilder.create(); - - if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) { - System.out.println("You have successfully deployed application: " + applicationId); - } else { - String resultString = CliUtils.getHttpResponseString(response); - ExceptionMapper exception = gson.fromJson(resultString, ExceptionMapper.class); - System.out.println(exception); - } + System.out.println(gson.fromJson(result, ResponseMessageBean.class).getMessage()); } catch (Exception e) { String message = "Could not deploy application: " + applicationId;
