Errors
The ORM uses the following error classes from @zenstackhq/runtime
to represent different types of failures:
ValidationError
​
This error is thrown when the argument passed to the ORM methods is invalid, e.g., missing required fields, or containing unknown fields. The cause
property is set to the original error thrown during validation.
NotFoundError
​
This error is thrown when a requested record is not found in the database, e.g., when calling findUniqueOrThrow
, update
, etc.
QueryError
​
This error is used to encapsulate all other errors thrown from the underlying database driver. The cause
property is set to the original error thrown.