fix(module-ejb, module-web): fix error response

This commit is contained in:
Damian Pierzchalski 2018-12-17 16:12:25 +01:00
parent 2596a23d9a
commit d594af2e64
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}

View File

@ -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();
}
}