handling RemoteException

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

Branch: refs/heads/master
Commit: 0bedd93cbfd708be0772560655653256c2f79025
Parents: eaf518c
Author: Dinithi <[email protected]>
Authored: Wed May 20 23:03:37 2015 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Wed May 20 23:10:30 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0bedd93c/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 1a0ca88..0a10a59 100644
--- 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -432,8 +432,7 @@ public class StratosApiV41 extends AbstractApi {
             return Response.ok().entity(new 
ResponseMessageBean(ResponseMessageBean.SUCCESS,
                     String.format("Cartridge deleted successfully: 
[cartridge-type] %s", cartridgeType))).build();
         } catch (RemoteException e) {
-            return Response.status(Response.Status.BAD_REQUEST).entity(new 
ResponseMessageBean(
-                    ResponseMessageBean.ERROR, e.getMessage())).build();
+            throw new RestAPIException(e.getMessage());
         } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException 
e) {
             return Response.status(Response.Status.BAD_REQUEST).entity(new 
ResponseMessageBean(
                     ResponseMessageBean.ERROR, 
e.getFaultMessage().getInvalidCartridgeTypeException().getMessage()))

Reply via email to