Catch Zend PDO Exception -


i'm wondering if can put try catch $application->bootstrap()->run();
catch pdo exceptions

this works, catches every exception, not want.

try {     $application->bootstrap()->run(); } catch (exception $e) {     print_r($e); } 

i had nasty incident of pdo exception being throw , displaying password application.ini!

worthy of note, have tried pdoexception, doesnt catched.

my db set in bootstrap run()

    try {         $db = $this->getpluginresource('db')->getdbadapter();         zend_registry::set('dbadapter', $db);     } catch (exception $e) {         echo 1;exit;     } 

note if put in wrong password locally , run app, not see 1, see blank page error reporting on.

go have database code , put try catch around code. if want pdo exceptions catch pdoexception. put catch(pdoexcetion_or_what_its_name_is $e) (and disable error output screen. write errors log file)


Comments

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -