Updated Branches: refs/heads/master fddb157ab -> 41e5f6975
Add error handling in cartridge subscription Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/c865b29f Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/c865b29f Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/c865b29f Branch: refs/heads/master Commit: c865b29f2eba1bb5a99bf29a154c17f29fde5d15 Parents: 9648a38 Author: Manula Thantriwatte <[email protected]> Authored: Thu Dec 12 16:23:07 2013 +0530 Committer: Manula Thantriwatte <[email protected]> Committed: Thu Dec 12 16:23:07 2013 +0530 ---------------------------------------------------------------------- .../java/org/apache/stratos/cli/RestCommandLineService.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/c865b29f/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 0f9d30e..72bcb44 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 @@ -341,6 +341,9 @@ public class RestCommandLineService { } else if (subscription.equals("" + CliConstants.RESPONSE_INTERNAL_SERVER_ERROR)) { System.out.println("Error in backend"); return; + } else if (subscription.equals("" + CliConstants.RESPONSE_AUTHORIZATION_FAIL)) { + System.out.println("Invalid operation. Authorization failed"); + return; } String subscriptionJSON = subscription.substring(20, subscription.length() -1); @@ -380,6 +383,9 @@ public class RestCommandLineService { } else if (subcriptionConnectInfo.equals("" + CliConstants.RESPONSE_INTERNAL_SERVER_ERROR)) { System.out.println("Error in backend"); return; + } else if (subscriptionOutput.equals("" + CliConstants.RESPONSE_AUTHORIZATION_FAIL)) { + System.out.println("Invalid operation. Authorization failed"); + return; } String subscriptionOutputJSON= subscriptionOutput.substring(20, subscriptionOutput.length() -1);
