Skip to content

Commit

Permalink
Added exception message in validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadasjad committed Sep 19, 2024
1 parent c2011b5 commit 1eada4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Validator/TableExistsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 35 in src/Validator/TableExistsHandler.php

View check run for this annotation

Codecov / codecov/patch

src/Validator/TableExistsHandler.php#L33-L35

Added lines #L33 - L35 were not covered by tests
}

if ($tableSchema === null) {
Expand Down

0 comments on commit 1eada4a

Please sign in to comment.