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 06-27-2009, 10:55 AM   #1 (permalink)
The Contributor
 
Runar's Avatar
 
Join Date: Nov 2008
Location: Norway
Posts: 58
Thanks: 20
Runar is on a distinguished road
Default How do you handle your (custom) errors?

Good evening!

I am currently playing around with classes, interfaces and different programming patterns, and this question yet again came to my mind. How do you handle errors in your applications?

For the moment I am storing all errors in a simple array, $_Errors, then looping through all array elements if an error exists. But this does not feel quite right.

Does any of you have experience with a class to display and react to different types of errors? Should I go with PHPs native error handling functions, like trigger_error() and exceptions, instead of making my own methods?


Yours, Runar
Send a message via MSN to Runar
Runar is offline  
Reply With Quote
Old 06-27-2009, 08:17 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

I used to asked me the same question every time I started a project.
Now the way I use them is if the site/web page can still function (or live) without certain functionality then I make that functionality (like a polling system) to throw Exceptions if there is something wrong with it. But if the site/web page is dependent on that functionality then I throw an error because it's more critical and I need to get to fix it quick.

I don't use my own error/exception handling. I just make sure I let the user now and let myself now (by sending an email, message, twit, ... whatever flows your boat).
tony 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
Optional Parameters in Custom functions.. Orc General 6 10-22-2012 09:43 AM
Help on Custom Data Storage TheOnly92 Advanced PHP Programming 35 05-21-2009 10:47 AM
modifying PHP.ini allworknoplay General 3 04-27-2009 02:50 PM
Coding errors KingOfTheSouth The Lounge 7 03-11-2009 02:02 AM
Muting errors in PHP5 Ross General 4 06-30-2008 03:13 PM


All times are GMT. The time now is 02:53 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