无法捕获JsonMappingException

我的IDE给我Unhandled Exception

com.fasterxml.jackson.databind.JsonMappingExceptionmapper.readValue行的错误

ObjectMapper mapper = new ObjectMapper();

try {

if (response.isEmpty()) {

//Http 204 (No Content) returned from MCC

//We should handle this differently

user = new User();

} else {

user = mapper.readValue(response, User.class);

}

} catch (IOException ioe) {

logger.log(Level.SEVERE, ioe.getLocalizedMessage());

}

return user;

我试着抓住,JsonMappingException但是并没有使错误消失。有什么想法吗?

回答:

JsonMappingException扩展了IOException,所以您的IDE本身就有了更深的麻烦-也许库导入被搞砸了?

以上是 无法捕获JsonMappingException 的全部内容, 来源链接: utcz.com/qa/405173.html

回到顶部