Re: Exception Handling

From: Date: Fri, 01 Jun 2012 16:26:52 +0000
Subject: Re: Exception Handling
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-318085@lists.php.net to get a copy of this message
Maybe "catch(Exception $e)" should be "catch(\Exception $e)"? On Fri, Jun 1, 2012 at 5:25 PM, James Colannino <crankycyclops@gmail.com> wrote: > Hey guys, > > Haven't posted in a long time...  Happy Memorial Day!  I have an issue with > exception handling.  I'm using a framework that throws a > "Database_Exception" object.  I was expecting catch (Exception $var) to be > sufficient to catch this, but it doesn't.  I have to do catch > (Database_Exception $var) to make it work.  I've been reading that Exception > should be sufficient, since every exception object is a child class of > Exception.  Did this perhaps change in 5.4?  I think it was working properly > in 5.3, but I'm not sure. > > Any clarification would be greatly appreciated! > > James > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#318085) next »