My try-catch blocks aren't working, and I'm trying to figure out why. I've reduced my code to the bare bones:
***************************************
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
try
{
if (1 == 1)
throw new Exception("Ick!");
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
?>
**************************************
This code generates the following error message:
Fatal error: Uncaught exception 'Exception' with message 'Ick!' in /home/goddess/public_html/except.php:9 Stack trace: #0 {main} thrown in /home/goddess/public_html/except.php on line 9
What in the world? Am I using the concept of try/catch inappropriately, or is it a problem with my server? (Is getmessage() built into the PHP language, or do I need to include something to use it?) If it's a problem with my server, any ideas what it might be (so I can talk with the tech people?) As it is, the tech people have said they don't have any idea...
Thanks so much!



Thanks.
Bookmarks