Browse Source

Do a hard exit when the SQL connection went down

pull/5192/head
Michael 3 years ago
parent
commit
87b5e26063
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      include/dba.php

+ 6
- 0
include/dba.php View 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;
}


Loading…
Cancel
Save