For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > April 2007 > die vs exception









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author die vs exception
Bruce Cowin

2007-04-30, 3:57 am

I have written a generic sql database class which contains a method =
RunQuery which uses mssql_query. To catch errors, should I include the =
"or die" clause or should I wrap it in a try/exception block? The first =
will stop the script running but for a generic class, I was thinking it'd =
be better to raise an exception and let the calling code handle it. I'd =
be interested to hear what everyone else does.

Thanks.



Regards,

Bruce
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com