Hi Victor,

There are no "constant" errors in the sql package if thats what you are
looking for.

Generally if .Ping() returns an error there is no connection - afaik the
error string might give some indication but it is totally up to the
driver/database.

If you want to sleep and try again later you can do it this way - but the
reason why .Ping() didn't succeed is unknown.

On Wed, Aug 3, 2016 at 4:34 PM Victor L <vlyamt...@gmail.com> wrote:

> Any idea how to check for connection error in database/sql?
>
> err := db.Ping()
> if err == CONNECTION_REFUSED (?) {
> time.Sleep
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to