sfackler / r2d2

A generic connection pool for Rust
Apache License 2.0
1.51k stars 82 forks source link

Error not returned until timeout occurs, no matter the error. #51

Closed kdar closed 6 years ago

kdar commented 6 years ago

So I noticed if I use the wrong username, password, port, etc... then I will not get an error back until the connection timeout has occurred. Is the canonical way of dealing with this to use something like the postgres crate directly and make sure the credentials are correct before setting up a pool?

sfackler commented 6 years ago

Yeah, you could open one connection up directly to make sure the configuration works. r2d2 doesn't know if an error was transient or permanent so it just has to try until it gives up.

kdar commented 6 years ago

Thank you!