From: Christian Weiske Date: Sun, 12 Aug 2012 11:17:32 +0000 (+0200) Subject: catch sql errors X-Git-Tag: v1.0.0~24 X-Git-Url: https://git.cweiske.de/auerswald-callnotifier.git/commitdiff_plain/af4c9d65fe811aec2933e8acd7a822dfde1e3940 catch sql errors --- diff --git a/src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php b/src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php index 2b48004..8345128 100644 --- a/src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php +++ b/src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php @@ -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;