fix(module-ejb, module-web): fix error response
This commit is contained in:
parent
2596a23d9a
commit
d594af2e64
@ -20,7 +20,7 @@ public class DataNotFoundExceptionMapper implements ExceptionMapper<DataNotFound
|
||||
@Override
|
||||
public Response toResponse(DataNotFoundException exception) {
|
||||
ErrorMessage errorMessage = new ErrorMessage(exception.getMessage(),404);
|
||||
return Response.status(404).entity(errorMessage).build();
|
||||
return Response.status(404).type("application/json; charset=UTF-8").entity(errorMessage).build();
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class GenericExceptionMapper implements ExceptionMapper<Throwable> {
|
||||
@Override
|
||||
public Response toResponse(Throwable exception) {
|
||||
ErrorMessage errorMessage = new ErrorMessage(exception.getMessage(), 500);
|
||||
return Response.status(500).entity(errorMessage).build();
|
||||
return Response.status(500).type("application/json; charset=UTF-8").entity(errorMessage).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user