From 22c5da1629cb18c4eb20c1ff49d4e727dc0c4a8d Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 4 May 2012 12:40:44 -0400 Subject: [PATCH] CC-3755: Found Exception in apache's error log -Return error code so that python services automatically retry later. --- airtime_mvc/application/models/Preference.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index c9c1f17a3..90e87b9b2 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -61,7 +61,13 @@ class Application_Model_Preference ." VALUES ($id, '$key', $value)"; } } - return $con->exec($sql); + try { + $con->exec($sql); + } catch (Exception $e){ + Logging::log("Could not connect to database."); + header('HTTP/1.0 503 Service Unavailable'); + exit; + } } public static function GetValue($key, $isUserValue = false){