Display call trace on exceptions reporting

This commit is contained in:
Pierre HUBERT 2018-08-20 13:34:44 +02:00
parent addd9f55e8
commit fba6c796a8

View File

@ -560,7 +560,12 @@ class DBLibrary {
//PDO informations //PDO informations
if($this->verbose){ if($this->verbose){
echo "\n PDO last error:";
echo "\n\n Call trace:";
echo $e->getTraceAsString();
echo "\n\n PDO last error:";
print_r($this->db->errorInfo()); print_r($this->db->errorInfo());
} }
} }
@ -573,9 +578,13 @@ class DBLibrary {
private function echoPDOException(PDOException $e){ private function echoPDOException(PDOException $e){
$message = '<b>Exception in '.$e->getFile().' on line '.$e->getLine().' </b>: '.$e->getMessage(); $message = '<b>Exception in '.$e->getFile().' on line '.$e->getLine().' </b>: '.$e->getMessage();
echo $message; echo $message;
//PDO informations //PDO informations
if($this->verbose){ if($this->verbose){
echo "\n\n Call trace:";
echo $e->getTraceAsString();
echo "\n PDO last error:"; echo "\n PDO last error:";
print_r($this->db->errorInfo); print_r($this->db->errorInfo);
} }