View Single Post
Old 05-10-2009, 08:09 PM   #17 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
new Core_Exception();
new Core_Database_Row();
I believe they we just examples to illustrate Zend's pseudo-namespace.

Quote:
Tanax: Take a look at the PHP documentation regarding the exceptions, and how to build your own. You're then able to distinguish between regular exceptions and more specific exceptions, such as database exceptions. With try blocks you're able to have a multitude of catch statements.
You can also define a top level exception handler using
set_exception_handler


PHP Code:

function ExceptionHandler(Exception $e)
{
    die(
'Erroooooorrrr:' $e->getMessage());
}
set_exception_handler('ExceptionHandler'); 
That will catch any uncaught exceptions (i.e. ones not in a try ... catch block) this can be expanded to determine what kind of exception was passed too.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
allworknoplay (05-10-2009)