if (response.hasEntity()) {
// try and convert it to LinkedInException
final org.apache.camel.component.linkedin.api.model.Error error = response.readEntity(Error.class);
throw new RuntimeCamelException(
String.format("Error invoking %s: %s", method.getName(), error.getMessage()),
new LinkedInException(error, response));
}
}
throw e;
}
}