mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
fixing VERIFONEEMMPROF-26
This commit is contained in:
parent
fb4d8ae990
commit
a8102b8c42
@ -57,11 +57,6 @@ public class GlobalThrowableMapper implements ExceptionMapper {
|
|||||||
if (e instanceof NotFoundException) {
|
if (e instanceof NotFoundException) {
|
||||||
return ((NotFoundException) e).getResponse();
|
return ((NotFoundException) e).getResponse();
|
||||||
}
|
}
|
||||||
if (e instanceof ConstraintViolationException) {
|
|
||||||
log.error("Constraint violation", e);
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).header("Content-Type", "application/json")
|
|
||||||
.entity(400l).build();
|
|
||||||
}
|
|
||||||
if (e instanceof UnexpectedServerErrorException) {
|
if (e instanceof UnexpectedServerErrorException) {
|
||||||
log.error("Unexpected server error", e);
|
log.error("Unexpected server error", e);
|
||||||
return ((UnexpectedServerErrorException) e).getResponse();
|
return ((UnexpectedServerErrorException) e).getResponse();
|
||||||
@ -70,9 +65,15 @@ public class GlobalThrowableMapper implements ExceptionMapper {
|
|||||||
return ((ParameterValidationException) e).getResponse();
|
return ((ParameterValidationException) e).getResponse();
|
||||||
}
|
}
|
||||||
if (e instanceof IllegalArgumentException) {
|
if (e instanceof IllegalArgumentException) {
|
||||||
log.error("Illegal exception.", e);
|
ErrorDTO errorDetail = new ErrorDTO();
|
||||||
return Response.status(Response.Status.BAD_REQUEST).header("Content-Type", "application/json")
|
errorDetail.setCode((long) 400);
|
||||||
.entity(400l).build();
|
errorDetail.setMoreInfo("");
|
||||||
|
errorDetail.setMessage("");
|
||||||
|
errorDetail.setDescription(e.getMessage());
|
||||||
|
return Response
|
||||||
|
.status(Response.Status.BAD_REQUEST)
|
||||||
|
.entity(errorDetail)
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
if (e instanceof ClientErrorException) {
|
if (e instanceof ClientErrorException) {
|
||||||
log.error("Client error", e);
|
log.error("Client error", e);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user