Can some one help me why SonarLint is showing this:
Either log this exception and handle it, or rethrow it with some contextual information.
for below piece of code.
public static <T> T getObjectFromJson(final Object jsonString, final Class<T> valueType) {
T object = null;
if (jsonString != null) {
try {
object = MAPPER.readValue(jsonString.toString(), valueType);
} catch (IOException io) {
log.error(ERROR_LOG_STR + " in method getObjectFromJson(). Exception Message={}, Exception Stack ={}",
io.getMessage(), io);
throw new ServiceException(ErrorMessages.JSON_SERIALIZATION_ERROR, io.getCause());
}
}
return object;
}