I am trying to throw an exception inside lambda but it keeps giving me an error saying that Unhandled IOException.
private <T> T getResponse(final RestURI query, final Class<T> responseClass) throws IOException {
return getValue(query,
reader -> {
try {
return mapper.readValue(reader, responseClass);
} catch (IOException e) {
throw new IOException("Exception while deserializing the output " + e.getMessage());
}
});
}
Can someone tell me what I am doing wrong ?