Error recovery - fatal errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like, in my app, to recover from as many run-time errors as possible, so that I can tidy up. And unsolicited output generated by the standard error system is really unhelpful as it becomes part of the ajax reply to the browser.

So I've added my own error handler, but it seems that I can't catch fatal errors. The error in question comes from doing something like:

$res = $dbh->query ($sql);

with $sql being an SQL statement, and $dbh being a database handle. I recently had a case where $dbh was NULL, which triggers a fatal error from SQLite. In principle such a bug should show up quickly, but this one had lain untriggered for about a year. It seems to me somewhat arbitrary for this to be designated a fatal error. Is there a way I can catch these? Most SQLite error situations I'm solving with try/catch but no luck with this one so far.

Error handling in library packages seems somewhat arbitrary - e.g. opendir may give an E_WARNING, but closedir, readdir don't.

tim


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux