Re: Exception Handling
| From: | Marco Behnke | Date: | Fri, 01 Jun 2012 19:51:13 +0000 |
| Subject: | Re: Exception Handling | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318088@lists.php.net to get a copy of this message | ||
Am 01.06.12 17:08, schrieb James Colannino:
>
> Hey Marco,
>
> Thanks for the reply! That was the first thing I checked.
>
> class Database_Exception extends \FuelException {}
> class Fuel_Exception extends \Exception {}
>
> It's extending Exception, as expected. Also, can you throw classes
> that don't extend Exception? It was always my understanding that
> doing so would cause a fatal error.
Ah, I guess that is the problem. Your application framework uses namespaces.
I guess you should try
catch (\Exception $e)
instead of
catch (Exception $e)
:-)
>
> James
>
--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
e-Mail: marco@behnke.biz
Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal
http://www.behnke.biz
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc