Package org.apache.camel.component.salesforce.api.dto

Examples of org.apache.camel.component.salesforce.api.dto.RestError


                        // parse the response to get error
                        final LoginError error = objectMapper.readValue(responseContent, LoginError.class);
                        final String msg = String.format("Login error code:[%s] description:[%s]",
                                error.getError(), error.getErrorDescription());
                        final List<RestError> errors = new ArrayList<RestError>();
                        errors.add(new RestError(msg, error.getErrorDescription()));
                        throw new SalesforceException(errors, HttpStatus.BAD_REQUEST_400);

                    default:
                        throw new SalesforceException(String.format("Login error status:[%s] reason:[%s]",
                            responseStatus, loginPost.getReason()), responseStatus);
View Full Code Here


        // this must be of type Error
        try {
            final Error error = unmarshalResponse(new ByteArrayInputStream(request.getResponseContentBytes()),
                    request, Error.class);

            final RestError restError = new RestError();
            restError.setErrorCode(error.getExceptionCode());
            restError.setMessage(error.getExceptionMessage());

            return new SalesforceException(Arrays.asList(restError), request.getResponseStatus());
        } catch (SalesforceException e) {
            String msg = "Error un-marshaling Salesforce Error: " + e.getMessage();
            return new SalesforceException(msg, e);
View Full Code Here

                        // parse the response to get error
                        final LoginError error = objectMapper.readValue(responseContent, LoginError.class);
                        final String msg = String.format("Login error code:[%s] description:[%s]",
                                error.getError(), error.getErrorDescription());
                        final List<RestError> errors = new ArrayList<RestError>();
                        errors.add(new RestError(msg, error.getErrorDescription()));
                        throw new SalesforceException(errors, HttpStatus.BAD_REQUEST_400);

                    default:
                        throw new SalesforceException(String.format("Login error status:[%s] reason:[%s]",
                            responseStatus, loginPost.getReason()), responseStatus);
View Full Code Here

TOP

Related Classes of org.apache.camel.component.salesforce.api.dto.RestError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.