How to properly handle/distinguish between errors
I'm using Drizzle ORM with a postgres.
I'd like to distinguish between certain errors that occur when inserting / querying the database.
In my current case, I would like to know specifically when my insertion fails as a result of a user not existing in the database.
(See the comments in the catch block in the following example)
The error I get when a user does not exist is like so:
What is the proper / best way to differentiate between causes of errors while using drizzle?
0 Replies