From 87b5e26063529a7a129ee6421a52d467c7896a15 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 24 May 2018 04:07:39 +0000 Subject: [PATCH] Do a hard exit when the SQL connection went down --- include/dba.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/dba.php b/include/dba.php index 1d3b432141..f3ec0507f5 100644 --- a/include/dba.php +++ b/include/dba.php @@ -473,6 +473,12 @@ class dba { logger('DB Error '.self::$errorno.': '.self::$error."\n". System::callstack(8)."\n".self::replaceParameters($sql, $params)); + // It doesn't make sense to continue when the database connection was lost + if ($errorno == 2006) { + logger('Giving up because of database error '.$errorno.': '.$error); + exit(1); + } + self::$error = $error; self::$errorno = $errorno; }