Скрываем логи

This commit is contained in:
2024-08-20 11:47:27 +03:00
parent 826ae10f10
commit 29eeb5bf77
8 changed files with 16 additions and 4112 deletions

View File

@ -70,9 +70,16 @@ class Database
} catch (PDOException $e) {
// При ошибке запроса сохраняем валидные данные в yaml-файл
$yaml = Yaml::dump($params);
file_put_contents(__DIR__ . '/not-recorded-in-db.yaml', $yaml);
file_put_contents(__DIR__ . '/not-recorded-in-db.yaml', $yaml, FILE_APPEND);
$message = "Ошибка запроса:" . $e->getMessage();
Logger::log(self::$logFile, $message);
// TODO узнать код ошибки
// SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
// if ($e->getCode() == 0) {
// $yaml = Yaml::dump($params);
// file_put_contents(__DIR__ . '/not-recorded-in-db.yaml', $yaml);
// exit(1);
// }
}
}
}