RE: PHP 5 try catch block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx] 
Sent: Tuesday, May 18, 2004 3:03 AM
To: Charles P. Killmer; php-windows@xxxxxxxxxxxxx
Subject: RE:  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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux