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 2b48004..8345128 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;