diff --git a/src/Validator/TableExistsHandler.php b/src/Validator/TableExistsHandler.php index d76be733..87fba40c 100644 --- a/src/Validator/TableExistsHandler.php +++ b/src/Validator/TableExistsHandler.php @@ -30,8 +30,9 @@ public function validate(mixed $value, object $rule, ValidationContext $context) try { $tableSchema = $this->connection->getTableSchema($value); - } catch (\Yiisoft\Db\Exception\Exception) { - $tableSchema = null; + } catch (\Yiisoft\Db\Exception\Exception $e) { + $result->addError($e->getMessage()); + return $result; } if ($tableSchema === null) {