From af4c9d65fe811aec2933e8acd7a822dfde1e3940 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 12 Aug 2012 13:17:32 +0200 Subject: [PATCH] catch sql errors --- src/callnotifier/CallMonitor/Detailler/OpenGeoDb.php | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.30.2