Skip to content

Commit

Permalink
driver-adapters: Map neon errors to Prisma errors (#4213)
Browse files Browse the repository at this point in the history
* driver-adapters: Map neon errors to Prisma errors

Approach taken: instead of duplicating error handling logic in TS, we
extract all information we need from the error and forward it to engine.
Engine is than reuses error parsing code from native driver.

`PostgresError` is intermediate form for storing this information.
It can be created from eithe `tokio_postgres` error or from JS. It then
gets parsed and converted to a `quaint:Error`.

This allows to handle most of the DB level errors (read: everything that
actually reached running DB). It does not handle TLS and networking
errors since these look completely different in JS. We'll need to handle
them later.

* Add hint & severity fields on TS side
  • Loading branch information
SevInf authored Sep 22, 2023
1 parent 53b9998 commit d96b0d4
Show file tree
Hide file tree
Showing 9 changed files with 287 additions and 257 deletions.
2 changes: 1 addition & 1 deletion quaint/src/connector/postgres.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod conversion;
mod error;
pub mod error;

use crate::{
ast::{Query, Value},
Expand Down
Loading

0 comments on commit d96b0d4

Please sign in to comment.