@Override public Object decode(Response response, Type type) throws IOException { Response.Body body = response.body(); if (body == null) { return null; } if (String.class.equals(type)) { return Util.toString(body.asReader()); } throw new DecodeException(format("%s is not a type supported by this decoder.", type)); } }
public static FeignException errorStatus(String methodKey, Response response) { String message = format("status %s reading %s", response.status(), methodKey); try { if (response.body() != null) { String body = Util.toString(response.body().asReader()); message += "; content:\n" + body; } } catch (IOException ignored) { // NOPMD } return new FeignException(response.status(), message); }
String message = ""; if (response.body() != null) { message = Util.toString(response.body().asReader()); try { final ObjectNode body = metacatJson.parseJsonObject(message);