public function errorAction() { try { //gestion des erreurs (envoi de mail, bdd,...) } catch (\Exception $e) { // do nothing : nullify this exception } $this->assign('isDebug', \org\equinox\utils\debug\DebugBarFactory::isDebug()); $this->assign('exception', $this->request->exception); $this->assign('exceptionName', get_class($this->request->exception)); }
/** * @param $pdo PDO * @param $query string * @return PDOStatement */ private function prepareStmt($query, $params) { if (\org\equinox\utils\debug\DebugBarFactory::isDebug()) { $this->debugQuery = new QueryDebug($query, $params); $debugArray = debug_backtrace(); if (sizeof($debugArray) >= 2) { $debugArray = $debugArray[1]; $this->debugQuery->file = $debugArray['file']; $this->debugQuery->line = $debugArray['line']; } \org\equinox\utils\debug\DebugBarFactory::add($this->debugQuery, 'Sql'); } try { $pdo = $this->getConnection(); $stmt = $pdo->prepare($query); $stmt->execute($params); } catch (\PDOException $e) { \org\equinox\utils\debug\DebugBarFactory::add($query, 'SqlDump'); \org\equinox\utils\debug\DebugBarFactory::add($params, 'SqlDump'); throw $e; } return $stmt; }