vapor / fluent-postgres-driver

🐘 PostgreSQL driver for Fluent.
MIT License
146 stars 53 forks source link

Fix PostgresError conformance to DatabaseError #143

Closed madsodgaard closed 4 years ago

madsodgaard commented 4 years ago

Fixes and tests PostgresError's conformance to DatabaseError. This fixes issues like when trying to catch a constraint failure, which previously would always return false (#143).

tanner0101 commented 4 years ago

I am not sure what to check for on isConnectionClosed, since when adding a test the error that was catched was a ChannelError.ioOnClosedChannel?

isConnectionClosed should probably be removed from FluentKit since I don't think any db errors can really conform to it. The individual connections already have an isClosed property, too.

tanner0101 commented 4 years ago

These changes are now available in 2.0.0-rc.1.1