/** * @param \Exception $e * @param \Kdyby\Persistence\Query $queryObject * * @throws \Exception */ private function handleQueryException(\Exception $e, Persistence\Query $queryObject) { $lastQuery = $queryObject instanceof QueryObject ? $queryObject->getLastQuery() : NULL; return new QueryException($e, $lastQuery, '[' . get_class($queryObject) . '] ' . $e->getMessage()); }