title: How to handle and work with fatal Errors
body: <p>I'm running a php script against an appliance that's worked great up until recently when a special circumstance has caused a fatal error.  </p>
  
  <pre><code>$soapClient = new SoapClient("/var/www/blah/someWSDL.wsdl", array('trace'=&gt;true, 'exceptions'=&gt;true,'location'=&gt;"https://hostName:8443/axl",'login' =&gt; "userName",'password'=&gt; "password"));
  
  $response = $soapClient-&gt;getLine(array("routePartitionName"=&gt;"PT-INHOUSE", "pattern"=&gt;"$row[callingPartyNumber]"));
  echo "&lt;TR&gt;&lt;TD class='body'&gt;" .  $response-&gt;return-&gt;line-&gt;description . "&lt;/TD&gt;&lt;TD class='body'&gt;" 
  </code></pre>
  
  <p>So, this will work in any situation where $response yields an output.  However, there are situations where it will not (very rare).  In those cases, this is generated;</p>
  
  <pre><code>Fatal error: Uncaught SoapFault exception: [soapenv:Server] Item not valid: 
  </code></pre>
  
  <p>In reading up on the issue, it sounds like what I should be doing is "catching" the error.  In the event that the fatal error occurs, I would like to bypass echoing $response->return->line->description and replace this output with text like "nothing found".  Is this possible to do with an if statement, such as "if fatal error occurs, output this"?  From what I've read, this is not something that is recommended.  Any help is appreciated.</p>