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/3c09660e Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3c09660e Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3c09660e Branch: refs/heads/master Commit: 3c09660e99dec176a386157f14ca899bd896e9a6 Parents: b5b6eed Author: Dinithi <[email protected]> Authored: Wed May 20 11:05:50 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Wed May 20 15:38:41 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/3c09660e/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;
