View Single Post
Old 06-09-2009, 12:14 PM   #6 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,324
Thanks: 5
Salathe is on a distinguished road
Default

Why not use a wider error/exception handler and have that respond appropriately to these conditions? It'll help centralise all of your error/exception handling so there is no need for ifs and buts all throughout your code, as etookbox mentioned. Within your handler you can look for a database connection error specifically (if you desire) and respond however you like (logging, send an email, print error page, or all of the above).
Salathe is offline  
Reply With Quote