Fix get curators method response, causing 500 error

This commit is contained in:
Konstantinos Triantafyllou 2022-09-01 12:04:18 +00:00
parent f2032304c1
commit 63aa4ea432
1 changed files with 1 additions and 1 deletions

View File

@ -462,7 +462,7 @@ public class RegistryService {
public Response getCurators(@PathParam("type") String type) { public Response getCurators(@PathParam("type") String type) {
try { try {
JsonElement response = calls.getAllCurators(type); JsonElement response = calls.getAllCurators(type);
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(response.toString())).type(MediaType.APPLICATION_JSON).build(); return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(response).toString()).type(MediaType.APPLICATION_JSON).build();
} catch (HttpClientErrorException e) { } catch (HttpClientErrorException e) {
String message = new JsonParser().parse(e.getResponseBodyAsString()).getAsJsonObject().get("message").getAsString(); String message = new JsonParser().parse(e.getResponseBodyAsString()).getAsJsonObject().get("message").getAsString();
return Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build(); return Response.status(e.getStatusCode().value()).entity(jsonUtils.createResponse(message).toString()).type(MediaType.APPLICATION_JSON).build();