catch sql errors
authorChristian Weiske <cweiske@cweiske.de>
Sun, 12 Aug 2012 11:17:32 +0000 (13:17 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 12 Aug 2012 11:17:32 +0000 (13:17 +0200)
src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php

index 2b4800483a72ba5d46c32a0d36a5e4b5457d0dfb..83451283674e28c91f57364bb32c904cd8722a12 100644 (file)
@@ -85,6 +85,12 @@ class CallMonitor_Detailler_OpenGeoDb implements CallMonitor_Detailler
             . ' OR vorwahl = ' . $this->db->quote(substr($number, 0, 6))
             . ' ORDER BY einwohner DESC'
         );
+        if ($stm === false) {
+            throw new \Exception(
+                implode(' - ', $this->db->errorInfo())
+            );
+        }
+
         $res = $stm->fetch();
         if ($res === false) {
             return null;