RE: [PHP-WIN] PHP 5 try catch block
| From: | Charles P. Killmer | Date: | Tue, 18 May 2004 12:58:34 +0000 |
| Subject: | RE: [PHP-WIN] PHP 5 try catch block | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-23754@lists.php.net to get a copy of this message | ||
Thanks. Is there any way to catch fatal errors, and have the script do
something else more gracefull. Like maybe log the error and redirect or
something.
Charles
-----Original Message-----
From: Vincent Jansen [mailto:vincent@shaken.nl]
Sent: Tuesday, May 18, 2004 3:03 AM
To: Charles P. Killmer; php-windows@lists.php.net
Subject: RE: [PHP-WIN] PHP 5 try catch block
You can only catch exceptions.
<?php
try {
....Script with lots of fatal errors.....
} catch (Exception $exception) {
echo "all ok";
}
?>
will allways result in fatal error
<?php
try {
throw new Exception();
} catch (Exception $exception) {
echo "all ok";
}
?>
results in "all ok" though.
Vincent