From 1945c5728a9c621bb5714032031cf3d1f20f53e4 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 11 Sep 2025 17:50:58 -0300 Subject: [PATCH] FIX: check missing table --- app/common/Implement/Log/Handler/MySQL.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/common/Implement/Log/Handler/MySQL.php b/app/common/Implement/Log/Handler/MySQL.php index 8d2bc1c..1a580f7 100644 --- a/app/common/Implement/Log/Handler/MySQL.php +++ b/app/common/Implement/Log/Handler/MySQL.php @@ -5,6 +5,7 @@ use Incoviba\Common\Define\Connection; use Monolog\Handler\AbstractProcessingHandler; use Monolog\Level; use Monolog\LogRecord; +use PDOException; use PDOStatement; class MySQL extends AbstractProcessingHandler @@ -69,13 +70,21 @@ QUERY; private function checkTableExists(): bool { $query = "SHOW TABLES LIKE 'monolog'"; - $result = $this->connection->query($query); + try { + $result = $this->connection->query($query); + } catch (PDOException) { + return false; + } return $result->rowCount() > 0; } private function checkTableDeprecatedExists(): bool { $query = "SHOW TABLES LIKE 'monolog_deprecated'"; - $result = $this->connection->query($query); + try { + $result = $this->connection->query($query); + } catch (PDOException) { + return false; + } return $result->rowCount() > 0; } private function createTable(): void -- 2.49.0