Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve salesforce error messages #218

Open
Crmmetry-Waba opened this issue Aug 5, 2019 · 1 comment
Open

Retrieve salesforce error messages #218

Crmmetry-Waba opened this issue Aug 5, 2019 · 1 comment

Comments

@Crmmetry-Waba
Copy link

I have a lead creation method in my controller.

However the submission is failing since Ive add addtional fields to it. How do I get it to display the correct error message so I can address it quickly.

"Salesforce response error" as the error message just doesnt cut it, Id like to know if i have the wrong data type and where.

If you recommend guzzle could you please give an example

@mathbles703
Copy link

mathbles703 commented Feb 4, 2020

This is something I've utilized to get the error to display in a nice format, it utilizes the guzzle exception code.

try{
....
}
catch(\GuzzleHttp\Exception\RequestException $e){
            $error = array(
                "error_details" => "Error Exception Data => [" . $e->getResponse()->getBody() . "]",
                "error_code" => "SALESFORCE_EXCEPTION"
            );
            return json_decode(json_encode($error));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants