I’m having problems catching an exception with this method:
public function newSoapClient($headers=array()){
try {
$headers = array_merge($headers, array('trace' => 1, 'exceptions' => TRUE));
$client = NEW SoapClient($this->wsdl(), $headers);
} catch (SoapFault $e) {
die($e->getMessage());
}
}
The value $this->wsdl() is invalid at the moment (ie unavailable) so SoapClient appears to be throwing a fatal exception. I need to catch this if possible, but I can’t work out how. Any ideas please guys?
Couldn’t tell you right now as I left work 3 hours ago, but basically it’s because no WSDL could be loaded (the connection will time out). My concern is if this happens on the front end of the site that I can’t display a friendly error or fall back to an alternative.