]> git.mxchange.org Git - friendica.git/commitdiff
Do a hard exit when the SQL connection went down
authorMichael <heluecht@pirati.ca>
Thu, 24 May 2018 04:07:39 +0000 (04:07 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 24 May 2018 04:07:39 +0000 (04:07 +0000)
include/dba.php

index 1d3b432141d525e015539b5b3a6864f5153749ca..f3ec0507f582c3e0ab6773ab8d13dde74eb9e5b2 100644 (file)
@@ -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;
                }