Quit if database connection was lost during "e"

This commit is contained in:
Michael 2018-06-11 03:56:19 +00:00
parent 8584e09e12
commit 738644a006

View File

@ -598,6 +598,13 @@ class dba {
logger('DB Error '.self::$errorno.': '.self::$error."\n".
System::callstack(8)."\n".self::replaceParameters($sql, $params));
// On a lost connection we simply quit.
// A reconnect like in self::p could be dangerous with modifications
if ($errorno == 2006) {
logger('Giving up because of database error '.$errorno.': '.$error);
exit(1);
}
self::$error = $error;
self::$errorno = $errorno;
}