}
List<JsonMappingException.Reference> paths = Lists.reverse(cause.getPath());
if (!paths.isEmpty()) {
JsonMappingException withLoc = new JsonMappingException(rootMessage(cause), wrapLoc, cause);
for (JsonMappingException.Reference path : paths) {
withLoc.prependPath(path);
}
return withLoc;
} else {
return new JsonMappingException(rootMessage(cause), wrapLoc, cause);
}