Fix on API response messages in store

err-handling-improve
Thashmi-nil 2 years ago
parent 80f0c332fb
commit 4be4cd0cc2

@ -402,7 +402,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
*/ */
private void validateRemoveAppFromFavouritesRequest(int appId) throws ApplicationManagementException { private void validateRemoveAppFromFavouritesRequest(int appId) throws ApplicationManagementException {
if (!isFavouriteApp(appId)) { if (!isFavouriteApp(appId)) {
String msg = "Provided appId " + appId + " is not a favourite app in order remove from favourites"; String msg = "Provided application is not a favourite app in order remove from favourites";
throw new BadRequestException(msg); throw new BadRequestException(msg);
} }
} }
@ -417,11 +417,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
try { try {
getApplication(appId); getApplication(appId);
} catch (NotFoundException e) { } catch (NotFoundException e) {
String msg = " No application exists for the provided appId " + appId; String msg = "Requested application does not exists for add to favourites.";
throw new BadRequestException(msg); throw new BadRequestException(msg);
} }
if (isFavouriteApp(appId)) { if (isFavouriteApp(appId)) {
String msg = "Provided appId " + appId + " is already a favourite app"; String msg = "Requested application is already in favourites list.";
throw new BadRequestException(msg); throw new BadRequestException(msg);
} }
} }

@ -224,7 +224,7 @@ public class ReviewManagerImpl implements ReviewManager {
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction(); ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Error occured while verifying whether application release is exists or not for UUID " + uuid; String msg = "Error occurred while verifying whether application release is exists or not for UUID " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} finally { } finally {
@ -360,7 +360,7 @@ public class ReviewManagerImpl implements ReviewManager {
return null; return null;
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction(); ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Error occured while getting reviewTmp with reviewTmp id " + reviewId + "."; String msg = "Error occurred while getting reviewTmp with reviewTmp id " + reviewId + ".";
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
@ -393,11 +393,11 @@ public class ReviewManagerImpl implements ReviewManager {
} }
return getReviewTree(this.reviewDAO.getAllReleaseReviews(releaseDTO.getId(), request, tenantId)); return getReviewTree(this.reviewDAO.getAllReleaseReviews(releaseDTO.getId(), request, tenantId));
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = "Error occured while getting all reviews for application uuid: " + uuid; String msg = "Error occurred while getting all reviews for application uuid: " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg ="Error occured while getting the DB connection to get all reviews for application release which" String msg ="Error occurred while getting the DB connection to get all reviews for application release which"
+ " has UUID " + uuid; + " has UUID " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
@ -423,12 +423,12 @@ public class ReviewManagerImpl implements ReviewManager {
ConnectionManagerUtil.openDBConnection(); ConnectionManagerUtil.openDBConnection();
return getReviewTree(this.reviewDAO.getAllActiveAppReviews(applicationReleaseIds, request, tenantId)); return getReviewTree(this.reviewDAO.getAllActiveAppReviews(applicationReleaseIds, request, tenantId));
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = "Error occured while getting all reviews for application which has an " String msg = "Error occurred while getting all reviews for application which has an "
+ "application release of uuid: " + uuid; + "application release of uuid: " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = "Error occured while getting the DB connection to get app app reviews."; String msg = "Error occurred while getting the DB connection to get app app reviews.";
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} finally { } finally {
@ -458,12 +458,12 @@ public class ReviewManagerImpl implements ReviewManager {
} }
return getReviewTree(reviewDtos); return getReviewTree(reviewDtos);
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = "Error occured while getting all " + username + "'s reviews for application which has an " String msg = "Error occurred while getting all " + username + "'s reviews for application which has an "
+ "application release of uuid: " + uuid; + "application release of uuid: " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = "Error occured while getting DB connection to get all " + username + "'s reviews for " String msg = "Error occurred while getting DB connection to get all " + username + "'s reviews for "
+ "application which has an application release of uuid: " + uuid; + "application which has an application release of uuid: " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
@ -486,7 +486,7 @@ public class ReviewManagerImpl implements ReviewManager {
.collect(Collectors.toList()); .collect(Collectors.toList());
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = String msg =
"Error occured while getting the DB connection to get application which has application release" "Error occurred while getting the DB connection to get application which has application release"
+ " of UUID: " + uuid; + " of UUID: " + uuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
@ -526,7 +526,7 @@ public class ReviewManagerImpl implements ReviewManager {
paginationResult.setRecordsTotal(numOfReviews); paginationResult.setRecordsTotal(numOfReviews);
return paginationResult; return paginationResult;
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = "Error occured while getting all reply comments for given review list"; String msg = "Error occurred while getting all reply comments for given review list";
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} }
@ -635,11 +635,11 @@ public class ReviewManagerImpl implements ReviewManager {
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction(); ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Error occured while deleting review with review id " + reviewId + "."; String msg = "Error occurred while deleting review with review id " + reviewId + ".";
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (TransactionManagementException e) { } catch (TransactionManagementException e) {
String msg = "Error occurred when handleing transaction to delete application reviews."; String msg = "Error occurred when handling transaction to delete application reviews.";
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} finally { } finally {
@ -663,16 +663,16 @@ public class ReviewManagerImpl implements ReviewManager {
return rating; return rating;
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
String msg = String msg =
"Error occured while getting the rating value of the application release uuid: " + appReleaseUuid; "Error occurred while getting the rating value of the application release uuid: " + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = "DB Connection error occured while getting the rating value of the application release uuid: " String msg = "DB Connection error occurred while getting the rating value of the application release uuid: "
+ appReleaseUuid; + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = "Error occured while getting all rating values for the application release UUID: " String msg = "Error occurred while getting all rating values for the application release UUID: "
+ appReleaseUuid; + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
@ -704,18 +704,18 @@ public class ReviewManagerImpl implements ReviewManager {
return rating; return rating;
} catch (DBConnectionException e) { } catch (DBConnectionException e) {
String msg = String msg =
"DB Connection error occured while getting app rating of the application which has application " "DB Connection error occurred while getting app rating of the application which has application "
+ "release for uuid: " + appReleaseUuid; + "release for uuid: " + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (ApplicationManagementDAOException e) { } catch (ApplicationManagementDAOException e) {
String msg = "Error occured while getting the application DTO for the application release uuid: " String msg = "Error occurred while getting the application DTO for the application release uuid: "
+ appReleaseUuid; + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);
} catch (ReviewManagementDAOException e) { } catch (ReviewManagementDAOException e) {
String msg = String msg =
"Error occured while getting all rating values of application which has the application release " "Error occurred while getting all rating values of application which has the application release "
+ "for UUID: " + appReleaseUuid; + "for UUID: " + appReleaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ReviewManagementException(msg, e); throw new ReviewManagementException(msg, e);

@ -367,14 +367,14 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
try { try {
device = DataHolder.getInstance().getDeviceManagementService().getDevice(deviceIdentifier, false); device = DataHolder.getInstance().getDeviceManagementService().getDevice(deviceIdentifier, false);
if (device == null) { if (device == null) {
String msg = "Invalid device identifier is received and couldn't find an deveice for the requested " String msg = "Invalid device identifier is received and couldn't find an device for the requested "
+ "device identifier. Device UUID: " + deviceIdentifier.getId() + " Device Type: " + "device identifier. Device UUID: " + deviceIdentifier.getId() + " Device Type: "
+ deviceIdentifier.getType(); + deviceIdentifier.getType();
log.error(msg); log.error(msg);
throw new BadRequestException(msg); throw new BadRequestException(msg);
} }
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
String msg = "Error occured while getting device data for given device identifier.Device UUID: " String msg = "Error occurred while getting device data for given device identifier.Device UUID: "
+ deviceIdentifier.getId() + " Device Type: " + deviceIdentifier.getType(); + deviceIdentifier.getId() + " Device Type: " + deviceIdentifier.getType();
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);

@ -58,7 +58,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
applicationManager.addAppToFavourites(appId); applicationManager.addAppToFavourites(appId);
return Response.status(Response.Status.OK).build(); return Response.status(Response.Status.OK).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Invalid payload found in the request. Hence verify the request payload."; String msg = e.getMessage();
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
@ -78,7 +78,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
applicationManager.removeAppFromFavourites(appId); applicationManager.removeAppFromFavourites(appId);
return Response.status(Response.Status.OK).build(); return Response.status(Response.Status.OK).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Invalid payload found in the request. Hence verify the request payload."; String msg = e.getMessage();
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
@ -147,7 +147,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
String msg = "Could not found an application release which is in " + applicationManager String msg = "Could not found an application release which is in " + applicationManager
.getInstallableLifecycleState() + " state."; .getInstallableLifecycleState() + " state.";
log.error(msg); log.error(msg);
return Response.status(Response.Status.OK).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} }
return Response.status(Response.Status.OK).entity(application).build(); return Response.status(Response.Status.OK).entity(application).build();
} catch (NotFoundException e) { } catch (NotFoundException e) {

@ -131,7 +131,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload data with the request. Hence, please verify the request payload."; String msg = e.getMessage();
log.error(msg); log.error(msg);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -144,7 +144,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
String msg = "Error occured while accessing application release for UUID: " + uuid; String msg = "Error occurred while accessing application release for UUID: " + uuid;
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} }
@ -164,7 +164,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
if (isRepliedForReview) { if (isRepliedForReview) {
return Response.status(Response.Status.CREATED).entity(reviewWrapper).build(); return Response.status(Response.Status.CREATED).entity(reviewWrapper).build();
} else { } else {
String msg = "Error occured when adding reply comment for the review. Please contact the administrator.."; String msg = "Error occurred when adding reply comment for the review. Please contact the administrator..";
log.error(msg); log.error(msg);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} }
@ -173,7 +173,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload data with the request to add reply comment. Hence, please verify the " String msg = "Invalid payload data found with the requested add reply comment. Hence, please verify the "
+ "request payload."; + "request payload.";
log.error(msg); log.error(msg);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
@ -182,7 +182,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
String msg = "Error occured while accessing application release for UUID: " + uuid; String msg = "Error occurred while accessing application release for UUID: " + uuid;
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
} }
@ -214,8 +214,12 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
String msg = "Couldn't found application release data for UUID " + uuid + " or Review for review ID: " + reviewId; String msg = "Couldn't found application release data for UUID " + uuid + " or Review for review ID: " + reviewId;
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) {
String msg = "Invalid payload data found with the request. Hence, please verify the request payload.";
log.error(msg);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
String msg = "You dont have permission to update application release review."; String msg = "You don't have permission to update application release review.";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.FORBIDDEN).entity(msg).build(); return Response.status(Response.Status.FORBIDDEN).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
@ -267,7 +271,7 @@ public class ReviewManagementAPIImpl implements ReviewManagementAPI {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (ReviewManagementException | ApplicationManagementException e) { } catch (ReviewManagementException | ApplicationManagementException e) {
String msg = "Error occured while getting review data for application release UUID: " + uuid; String msg = "Error occurred while getting review data for application release UUID: " + uuid;
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
} }

@ -93,12 +93,11 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
SubAction.valueOf(action.toUpperCase()), timestamp, properties); SubAction.valueOf(action.toUpperCase()), timestamp, properties);
} }
} catch (NotFoundException e) { } catch (NotFoundException e) {
String msg = "Couldn't found an application release for UUI: " + uuid; String msg = "Couldn't found an application release for UUID: " + uuid;
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload for installing application which has UUID: " + uuid + ". Hence verify " String msg = e.getMessage();
+ "the payload";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -147,8 +146,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload for installing application which has UUID: " + uuid + ". Hence verify " String msg = e.getMessage();
+ "the payload";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -187,13 +185,12 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
SubAction.valueOf(SubAction.INSTALL.toString().toUpperCase()), timestamp, null); SubAction.valueOf(SubAction.INSTALL.toString().toUpperCase()), timestamp, null);
} }
} catch (NotFoundException e) { } catch (NotFoundException e) {
String msg = "Couldn't found an application release for UUI: " + uuid + " to perform ent app installation " String msg = "Couldn't found an application release for UUID: " + uuid + " to perform ent app installation "
+ "on subscriber's devices"; + "on subscriber's devices";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload when performing ent app installation on application which has UUID: " String msg = e.getMessage();
+ uuid + ". Hence verify the payload of the request.";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -237,8 +234,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload when performing ent app installation on application which has UUID: " String msg = e.getMessage();
+ uuid + ". Hence verify the payload of the request.";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -360,7 +356,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "User requested details are not valid"; String msg = "User requested details are not valid. Please verify the payload of the request.";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -424,8 +420,7 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "Found invalid payload for getting application which has UUID: " + uuid String msg = "Invalid payload found when getting application. Hence verify the payload";
+ ". Hence verify the payload";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ForbiddenException e) { } catch (ForbiddenException e) {
@ -502,6 +497,10 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
String msg = "Application with application release UUID: " + uuid + " is not found"; String msg = "Application with application release UUID: " + uuid + " is not found";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) {
String msg = "Invalid payload found with the request. Please verify the payload.";
log.error(msg,e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {
String msg = "Error occurred while getting application with the application " + String msg = "Error occurred while getting application with the application " +
"release uuid: " + uuid; "release uuid: " + uuid;

@ -133,7 +133,7 @@ public class SubscriptionManagementAdminAPIImpl implements SubscriptionManagemen
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); return Response.status(Response.Status.NOT_FOUND).entity(msg).build();
} catch (BadRequestException e) { } catch (BadRequestException e) {
String msg = "User requested details are not valid"; String msg = "User requested details are not valid. Please verify the request payload.";
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} catch (ApplicationManagementException e) { } catch (ApplicationManagementException e) {

Loading…
Cancel
Save