Скрываем логи
This commit is contained in:
@ -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);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user