From 453559a07b5d8d861cf0e14f3262e7d607c80781 Mon Sep 17 00:00:00 2001 From: nishadi Date: Wed, 17 Jan 2018 11:24:54 +0530 Subject: [PATCH] Modify CommentManagementAPIImpl returned Error Response. --- .../mgt/api/services/impl/CommentManagementAPIImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java index 2c1830c57ff..f920ccb9632 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java @@ -63,6 +63,7 @@ public class CommentManagementAPIImpl implements CommentManagementAPI{ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } catch (SQLException e) { log.error("SQL Exception occurs", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } return Response.status(Response.Status.OK).entity(comments).build(); } @@ -121,11 +122,11 @@ public class CommentManagementAPIImpl implements CommentManagementAPI{ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } catch (SQLException e) { log.error("SQL Exception occurs", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); }catch (DBConnectionException e) { log.error("DB Connection Exception occurs", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } - - return Response.status(Response.Status.OK).entity(comment).build(); } @Override @@ -164,6 +165,7 @@ public class CommentManagementAPIImpl implements CommentManagementAPI{ Stars= commentsManager.getStars(uuid); } catch (SQLException e) { log.error("SQL Exception occurs", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } return Response.status(Response.Status.OK).entity(Stars).build(); } @@ -182,6 +184,7 @@ public class CommentManagementAPIImpl implements CommentManagementAPI{ ratedUsers= commentsManager.getRatedUser(uuid); } catch (SQLException e) { log.error("SQL Exception occurs", e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } return Response.status(Response.Status.OK).entity(ratedUsers).build(); }