hyperledger / aries-askar

Secure storage designed for Hyperledger Aries agents.
Apache License 2.0
59 stars 45 forks source link

Open does not throw NotFound error when used with neon.tech #160

Open TimoGlastra opened 1 year ago

TimoGlastra commented 1 year ago

Maybe this is a neon.tech issue, but the open method in the postgresql provision.rs, checks whether the error code is 3D000 (invalid catalog name) and then assumes the database does not exist. However neon.tech will throw an error XX000 (internal error), with the message database "my-wallet4" does not exist. This means the normal flow will fail.

Is there something we can do to still treat this as "NotFound"?

berendsliedrecht commented 1 year ago

Hmm it seems to be an neon.tech issue as they are using the incorrect error code for a db not found.

relevant snippet:

https://github.com/neondatabase/neon/blob/67d2fa6dec41af962655198b13f9f8f3a7dc6ef4/libs/postgres_backend/src/lib.rs#L48

So the best thing would be for neon.tech to throw the correct error code for this message and not change anything in Askar as I think that this is the correct way to deal with this issue.

andrewwhitehead commented 1 year ago

I don't think there's an issue for this in the neon database repo is there?