use of org.apache.camel.component.salesforce.api.dto.bulk.Error in project camel by apache.
the class DefaultBulkApiClient method createRestException.
@Override
protected SalesforceException createRestException(Response response, InputStream responseContent) {
// this must be of type Error
try {
final Error error = unmarshalResponse(responseContent, response.getRequest(), Error.class);
final RestError restError = new RestError();
restError.setErrorCode(error.getExceptionCode());
restError.setMessage(error.getExceptionMessage());
return new SalesforceException(Arrays.asList(restError), response.getStatus());
} catch (SalesforceException e) {
String msg = "Error un-marshaling Salesforce Error: " + e.getMessage();
return new SalesforceException(msg, e);
}
}
Aggregations