die vs exception
| From: | Bruce Cowin | Date: | Mon, 30 Apr 2007 04:27:51 +0000 |
| Subject: | die vs exception | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43513@lists.php.net to get a copy of this message | ||
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