| @@ 33-42 (lines=10) @@ | ||
| 30 | try { |
|
| 31 | $result = parent::query($query); |
|
| 32 | } catch (Exception $e) { |
|
| 33 | if (config('app.debug') === true) { |
|
| 34 | if (isset($this->queryString)) { |
|
| 35 | dump($this->queryString); |
|
| 36 | } |
|
| 37 | dump('Go to '.config('app.rootUrl').'?install=1 to install DB'); |
|
| 38 | throw new Ajde_Db_Exception($e->getMessage()); |
|
| 39 | } else { |
|
| 40 | Ajde_Exception_Log::logException($e); |
|
| 41 | die('DB connection problem. <a href="?install=1">Install database?</a>'); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| 45 | //$cache->set($query, serialize($result)); |
|
| @@ 83-94 (lines=12) @@ | ||
| 80 | } catch (Exception $e) { |
|
| 81 | if (substr_count(strtolower($e->getMessage()), 'integrity constraint violation')) { |
|
| 82 | throw new Ajde_Db_IntegrityException($e->getMessage()); |
|
| 83 | } else { |
|
| 84 | if (config('app.debug') === true) { |
|
| 85 | if (isset($this->queryString)) { |
|
| 86 | dump($this->queryString); |
|
| 87 | } |
|
| 88 | dump('Go to '.config('app.rootUrl').'?install=1 to install DB'); |
|
| 89 | throw new Ajde_Db_Exception($e->getMessage()); |
|
| 90 | } else { |
|
| 91 | Ajde_Exception_Log::logException($e); |
|
| 92 | die('DB connection problem. <a href="?install=1">Install database?</a>'); |
|
| 93 | } |
|
| 94 | } |
|
| 95 | } |
|
| 96 | $time = microtime(true) - $start; |
|
| 97 | $log['time'] = round($time * 1000, 0); |
|