qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1785950 - /qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java
Date Wed, 08 Mar 2017 11:49:30 GMT
Author: kwall
Date: Wed Mar  8 11:49:30 2017
New Revision: 1785950

URL: http://svn.apache.org/viewvc?rev=1785950&view=rev
Log:
QPID-7682: [CloudFoundry] Report failures from the CloudFoundary endpoint as BAD_GATEWAY (502)
rather than 500.

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java?rev=1785950&r1=1785949&r2=1785950&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java
Wed Mar  8 11:49:30 2017
@@ -59,7 +59,7 @@ import org.apache.qpid.server.model.Trus
 import org.apache.qpid.server.security.auth.manager.oauth2.OAuth2UserPrincipal;
 import org.apache.qpid.server.security.group.GroupPrincipal;
 import org.apache.qpid.server.util.ConnectionBuilder;
-import org.apache.qpid.server.util.ConnectionScopedRuntimeException;
+import org.apache.qpid.server.util.ExternalServiceException;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 
 /*
@@ -223,8 +223,8 @@ public class CloudFoundryDashboardManage
         }
         catch (IOException e)
         {
-            throw new ConnectionScopedRuntimeException(String.format("Could not connect to
CloudFoundryDashboardManagementEndpoint '%s'.",
-                                                                     cloudFoundryEndpoint),
e);
+            throw new ExternalServiceException(String.format("Could not connect to CloudFoundryDashboardManagementEndpoint
'%s'.",
+                                                             cloudFoundryEndpoint), e);
         }
 
         try (InputStream input = connection.getInputStream())
@@ -236,18 +236,18 @@ public class CloudFoundryDashboardManage
             Object mayManageObject = responseMap.get("manage");
             if (mayManageObject == null || !(mayManageObject instanceof Boolean))
             {
-                throw new ConnectionScopedRuntimeException("CloudFoundryDashboardManagementEndpoint
response did not contain \"manage\" entry.");
+                throw new ExternalServiceException("CloudFoundryDashboardManagementEndpoint
response did not contain \"manage\" entry.");
             }
             return (boolean) mayManageObject;
         }
         catch (JsonProcessingException e)
         {
-            throw new ConnectionScopedRuntimeException(String.format("CloudFoundryDashboardManagementEndpoint
'%s' did not return json",
+            throw new ExternalServiceException(String.format("CloudFoundryDashboardManagementEndpoint
'%s' did not return json",
                                                                      cloudFoundryEndpoint),
e);
         }
         catch (IOException e)
         {
-            throw new ConnectionScopedRuntimeException(String.format("Connection to CloudFoundryDashboardManagementEndpoint
'%s' failed",
+            throw new ExternalServiceException(String.format("Connection to CloudFoundryDashboardManagementEndpoint
'%s' failed",
                                                                      cloudFoundryEndpoint),
e);
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message