/** * Check if $e is PEAR error, if so, throw as DbException * * @param $e PEAR_Error|array|object|int */ private function assertError($e, $depth = 2) { if (!Misc::isError($e)) { return; } list($file, $line) = self::getTrace($depth); Error_Handler::logError(array($e->getMessage(), $e->getDebugInfo()), $file, $line); $de = new DbException($e->getMessage(), $e->getCode()); $de->setExceptionLocation($file, $line); error_log($de->getMessage()); error_log($de->getTraceAsString()); throw $de; }