Technically, this is what you are looking for:
try { try { //some soap stuff } catch (SoapFault $sf) { throw new Exception('Soap Fault'); } } catch (Exception $e) { echo $e->getMessage(); }
however, I agree that exceptions should not be used to control flow. A better way would be this:
function show_error($message) { echo "Error: $message\n"; } try { //some soap stuff } catch (SoapFault $sf) { show_error('Soap Fault'); } catch (Exception $e) { show_error($e->getMessage()); }
Chris eberle
source share