stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [1/2] git commit: Fixing authentication failure handling logic in CLI
Date Sun, 12 Oct 2014 02:51:30 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 2e1a50207 -> 11eb753fe


Fixing authentication failure handling logic in CLI


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e5bebe5a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e5bebe5a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e5bebe5a

Branch: refs/heads/master
Commit: e5bebe5a1edca2d2feec60ecf6bd9180c327bca2
Parents: 2e1a502
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Sun Oct 12 00:57:04 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Sun Oct 12 00:57:04 2014 +0530

----------------------------------------------------------------------
 .../apache/stratos/cli/RestCommandLineService.java | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e5bebe5a/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 8db4b9b..9c326c6 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
@@ -195,11 +195,20 @@ public class RestCommandLineService {
                 // Just return true as we don't need to validate
                 return true;
             }
-        } catch (ClientProtocolException e) {
-            System.out.println("Authentication failed!");
-            return false;
         } catch (ConnectException e) {
-            System.out.println("Could not connect to stratos manager");
+            String message = "Could not connect to stratos manager";
+            System.out.println(message);
+            logger.error(message, e);
+            return false;
+        } catch (java.lang.NoSuchMethodError e) {
+            String message = "Authentication failed!";
+            System.out.println(message);
+            logger.error(message, e);
+            return false;
+        } catch (Exception e) {
+            String message = "An unknown error occurred: " + e.getMessage();
+            System.out.println(message);
+            logger.error(message, e);
             return false;
         } finally {
             httpClient.getConnectionManager().shutdown();


Mime
View raw message