Unique constraint violation error is not clearly surfaced in Drizzle ORM

When inserting into a table with a unique constraint, Drizzle ORM throws a generic error like Failed query, without surfacing the actual PostgreSQL error message or code (23505). Expected: A clear error or exception message indicating that a unique constraint was violated, ideally with the offending column and value.
2 Replies
Angelelz
Angelelz3mo ago
Didn't they introduce and error wrapper in v0.44? The original error should be in the cause property
M Zeeshan
M ZeeshanOP3mo ago
my bad i didnt read changelog

Did you find this page helpful?