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
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-10-2008, 05:02 PM   #1 (permalink)
The Visitor
 
Farmer's Avatar
 
Join Date: Dec 2008
Posts: 4
Thanks: 0
Farmer is on a distinguished road
Default Error Handling and Exceptions

I have heard a lot about error handling and exceptions. Do we really need them. If we can check check errors with custom functions, do we really need error handling & exceptions.

Are they really very useful?
Farmer is offline  
Reply With Quote
Old 12-10-2008, 09:30 PM   #2 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Well, for one thing - you don't have to write custom functions cause you have the error handling and exceptions.
__________________
Tanax is offline  
Reply With Quote
Old 12-11-2008, 11:36 AM   #3 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

I am unsure about you question, I think we do need error handling, I think its important to be able to process any errors the script may produce in a controlled way instead of just farting out the fatal error to people, opening up a whole new pandoras box of problems including and not limited too: security problems and making your site look unprofessional.
Making your script fail gracefully very important, in my opinion.

Sorry if i have misunderstood.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 12-11-2008, 06:41 PM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I'm also not sure exactly what is being asked here. Checking errors with custom functions is error handling! As for error handling and exception handling, they're both important and it's all too easy to (wrongly) either only handle 'errors' (by routing exceptions through error handlers) or 'exceptions' (by routing errors through exception handlers).
Salathe is offline  
Reply With Quote
Reply



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
Exceptions and suppressing mysqli errors delayedinsanity Advanced PHP Programming 12 05-07-2008 07:27 PM
Using Exceptions to Provide Better Feedback Wildhoney Tips & Tricks 5 11-19-2007 06:55 AM


All times are GMT. The time now is 03:16 PM.

 
     

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