davispeixoto / Laravel-5-Salesforce

Laravel 5 wrapper for Salesforce Force.com Toolkit SOAP API
MIT License
47 stars 36 forks source link

Try Catch Connection #31

Closed gabohm closed 6 years ago

gabohm commented 7 years ago

There is a way to try catch a error in the connection?

Something like this:

try {
require_once ('soapclient/SforceEnterpriseClient.php'); require_once ('soapclient/SforceHeaderOptions.php'); $mySforceConnection = new SforceEnterpriseClient(); $mySoapClient = $mySforceConnection->createConnection('soapclient/enterprise.wsdl.xml'); $mylogin = $mySforceConnection->login("user", "passtoken"); } catch (Exception $e) { var_dump($e->faultstring); }

davispeixoto commented 6 years ago

You can try using my other underlying library, instead of this wrapper

https://packagist.org/packages/davispeixoto/force-dot-com-toolkit-for-php https://github.com/davispeixoto/Force.com-Toolkit-for-PHP

But by default, SoapClient class does not throw any exceptions