note 46416 added to language.oop5.exceptions
| From: | gomikochar at yahoo dot com | Date: | Sun, 10 Oct 2004 14:00:05 +0000 |
| Subject: | note 46416 added to language.oop5.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78303@lists.php.net to get a copy of this message | ||
To re-throw an exception, you must specify the name of the variable after throw in the catch block,
i.e.,
<?php
try {
try {
throw new Exception("Unknown error");
}
catch (Exception $ie) { // Inner Catch Block
throw; // this will NOT work; parse error
throw $ie; // this will re-throw the exception to the outer catch block
}
}
catch (Exception $oe) { // Outer Catch Block
echo $oe;
}
?>
----
Manual Page -- http://www.php.net/manual/en/language.oop5.exceptions.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46416
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46416&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46416&report=yes
Search -- http://master.php.net/manage/user-notes.php