Re: [PHP] When is an Exception not an Exception?



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


Relevant Pages

  • Re: Vector and derived classes objects
    ... > wont be called for the objects the pointer points to, hence I dont see ... > any way an exception can be thrown there with my push_back. ... Josuttis as also mentiones that in his STL book. ...
    (comp.lang.cpp)
  • Re: Monte Carlo computer go methods
    ... When I hear of these rapid advancements, ... mostly what every book says: lots of study, trying to play the moves they learn even if they dont understand them, reading, counting liberties, never play a move which one has been told is bad *until* they are sure this is an exception, etc. ...
    (rec.games.go)
  • Re: inheritance question
    ... With the sample code below i get the error that i dont have enough ... arguments for the constructor i dont understand why i am getting that ... ie the "path" which was followed to reach the exception. ...
    (comp.lang.ruby)
  • Re: Threads and Exceptions
    ... you dont have a try catch in the function then you dont get notified ... about the unhandled exception. ... simply watches the stream until an escape character appears in the ... I launch a watchdog function with its own thread. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: System.Directoryservices getting TxIsolationLevel exeption?
    ... exception that was thrown and rethrowing it with a more generic exception. ... If you ever do catch and rethrow, ... > Hi Joe.. ... > I dont know if this makes any different but I am trying to add a user ...
    (microsoft.public.dotnet.framework.aspnet.security)