note 76365 rejected from function.soapfault-soapfault by nlopess
| From: | nlopess@php.net | Date: | Fri, 27 Jul 2007 11:38:26 +0000 |
| Subject: | note 76365 rejected from function.soapfault-soapfault by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128965@lists.php.net to get a copy of this message | ||
Note Submitter: jsixpack at gee-mail dot com
----
Don't think that SoapFault is a regular Exception; it isn't.
Method getMessage() returns en empty string.
Work around:
try {
// some soap calls go here...
} catch (Exception $e) {
if (get_class($e) == 'SoapFault') {
do_something($e->faultcode, $e->faultstring);
} else {
do_something($e->getCode(), $e->getMessage());
}
}