Re: [PHP] When is an Exception not an Exception?
- From: quickshiftin@xxxxxxxxx ("Nathan Nobbe")
- Date: Wed, 31 Dec 2008 12:55:00 -0700
On Wed, Dec 31, 2008 at 12:41 PM, <ceo@xxxxxxxxx> wrote:
We have code like this:
try
{
$details = $this->__client->getData($email); //Line 274
}
catch (SoapFault $sf)
{
//do stuff
}
catch (Exception $e)
{
//do more general stuff
}
SoapFault: No data found in C:\classes\Client.php on line 274
Hello?
What is the point of all this try/catch stuff, eh?
you dont have to use it if you dont want, in fact you could strip it out of
that code segment if you wanted to.
I don't think we've done anything particularly fancy/tricky with the class
hierarchy.
nobody said you did, but that has no bearing on the fact that the Soap
extension throws exceptions. as i said you dont have to catch them, but the
idea is they provide opportunities for your code to degrade gracefully in
the event of a problem occurring.
-nathan
- References:
- When is an Exception not an Exception?
- From: ceo
- When is an Exception not an Exception?
- Prev by Date: When is an Exception not an Exception?
- Next by Date: Re: [PHP] When is an Exception not an Exception?
- Previous by thread: When is an Exception not an Exception?
- Next by thread: Re: [PHP] When is an Exception not an Exception?
- Index(es):
Relevant Pages
|