TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-17-2009, 08:57 AM   #1 (permalink)
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
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error handling Ross TalkPHP Developer Team 0 01-17-2009 10:27 PM
Error Handling and Exceptions Farmer Absolute Beginners 3 12-11-2008 06:41 PM
uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ER Orc Javascript, AJAX, E4X 2 02-26-2008 02:12 PM
Using Exceptions to Provide Better Feedback Wildhoney Tips & Tricks 5 11-19-2007 06:55 AM
File_Get_Contents exception WinSrev General 7 09-25-2007 09:25 PM


All times are GMT. The time now is 12:42 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design