Search in sources :

Example 1 with Error

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);
    }
}
Also used : SalesforceException(org.apache.camel.component.salesforce.api.SalesforceException) RestError(org.apache.camel.component.salesforce.api.dto.RestError) RestError(org.apache.camel.component.salesforce.api.dto.RestError) Error(org.apache.camel.component.salesforce.api.dto.bulk.Error)

Aggregations

SalesforceException (org.apache.camel.component.salesforce.api.SalesforceException)1 RestError (org.apache.camel.component.salesforce.api.dto.RestError)1 Error (org.apache.camel.component.salesforce.api.dto.bulk.Error)1