WebmasterForums.NET - Webmaster Forums & Directory
 

Go Back   WebmasterForums.NET - Webmaster Forums & Directory > Design and Development > Site Programming and Coding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Site Programming and Coding Have a problem with some code on your site? Ask our other members for advice and help.

Reply
 
Thread Tools Display Modes
Old 07-31-2006, 01:13 PM   #1
Shoshana
Senior Member
 
Shoshana's Avatar
 
Join Date: Jul 2006
Location: NY
Posts: 104
Shoshana is on a distinguished road
Send a message via AIM to Shoshana
Default php exceptions

Hello!
I need to make a big software project. The reliability of this project
is very important, so i'm thinking of handeling errors using exceptios.
Is this the best way to handle errors?

P.S.: the interface is not a graphical one. I use php5-cli.
Shoshana is offline   Reply With Quote
Old 07-31-2006, 01:13 PM   #2
Shoshana
Senior Member
 
Shoshana's Avatar
 
Join Date: Jul 2006
Location: NY
Posts: 104
Shoshana is on a distinguished road
Send a message via AIM to Shoshana
Default

What the best method is to handle errors has been quite a discussion in
the past years. It all depends on wether and how you want your program
to resume after a crash.
Sometimes you might want a program to continue on the next line after a
crash occurred. For example when trying to delete a bunch of images and
one of the images doesn't exist.

On the other hand, if you want to do some stock calculations and stuff
you'd want your stock to be transferred to another person's stock,
you'll want to make sure that both transactions can finish before even
executing them. Otherwise you might screw the data.

So sometimes it's good to ignore errors, at other moments it's better
not to.

Best of all, you can also choose not to make any errors

Btw... Reliability of an application doesnt only involve good error
handling. Choosing the right database engine and structure and good
application design can save you a lot of time programming, and will make
your application more robust.

Good luck.
Shoshana is offline   Reply With Quote
Old 07-31-2006, 01:13 PM   #3
Shoshana
Senior Member
 
Shoshana's Avatar
 
Join Date: Jul 2006
Location: NY
Posts: 104
Shoshana is on a distinguished road
Send a message via AIM to Shoshana
Default

Rule in calculating chances is that everything that CAN happen WILL
happen as soon as you let your users work with your program. Things that
can occur in < 1% of the time will happen, and therefore need to be secured.
Working with exceptions doesn't solve all problems that can occur. I'd
say check which method to use on what situation and take a good look at
batch executions to determine what would happen if something went wrong.
Shoshana is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump


All times are GMT. The time now is 03:19 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
WebmasterForums.NET - Webmaster Forums & Directory