Thread: php exceptions
View Single Post
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