View Single Post
Old 05-17-2009, 08:57 AM   #1 (permalink)
captainmerton
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default Exception Handling

I am using the generic php5 Exception class to "catch" errors in my script. I have the code i want to trap errors from within the "try" clause. However while this is useful for displaying errors I want to perform different code before display of error depending on whether i've caught an error or not. can someone advise what the code would be to do this?

eg.

try {

Do some stuff

If error-caught {
do some error related stuff
}

catch(Exception $error) {
print $error->getMessage();
}
captainmerton is offline  
Reply With Quote