From 1f5d7c5e7d24bf3fb7148fbfb7bb4e0c0cc29e6f Mon Sep 17 00:00:00 2001 From: Ahmad Asjad Date: Thu, 19 Sep 2024 10:27:49 +0530 Subject: [PATCH] handled Yiisoft\\Db\\Exception\\Exception --- src/Validator/TableExistsHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Validator/TableExistsHandler.php b/src/Validator/TableExistsHandler.php index 6f550940..4aec3cba 100644 --- a/src/Validator/TableExistsHandler.php +++ b/src/Validator/TableExistsHandler.php @@ -28,7 +28,11 @@ public function validate(mixed $value, object $rule, ValidationContext $context) $result = new Result(); - $tableSchema = $this->connection->getTableSchema($value); + try{ + $tableSchema = $this->connection->getTableSchema($value); + } catch (\Yiisoft\Db\Exception\Exception $e) { + $tableSchema = null; + } if ($tableSchema === null) { $result->addError(sprintf('Table "%s" does not exist.', $value));