Invalid @Check Instances Should Throw ConstraintViolationException Instead of DriverException #2836
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
Mikro ORM v5 added the
@Check
decorator. When adding@Check
instances to my app and writing tests, I noticed that when a check is invalid, the lower-levelDriverException
is being thrown. Given that Postgres defines checks as a form of constraint, I would have expected the more-granularConstraintViolationException
to be thrown.Describe the solution you'd like
Invalid Postgres checks throw the more specific
ConstraintViolationException
. Alternatively, they could get an even-more-granular exceptionCheckConstrainViolationException
, but Postgres defines checks as the most generic constraint type, so I don't see a huge need for this.Additional context
I am using Mikro ORM 5.0.5.
The text was updated successfully, but these errors were encountered: