You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least connectError in https://github.com/jackc/pgx/blob/master/pgconn/errors.go — right now, all I can do to prevent users seeing some failed to connect to 'host=%s user=%s database=%s': %s (eg. on overload such as I like to provoke in my test environments) or similar is to give a bland "database problem" or "internal error" on un-matchable (eg. via the very handy SafeToRetry / Timeout helpers) errors .
In this example, if I could without string-pattern-matching detect the ConnectError (vs. others that might also arise from my random current QueryContext/ExecContext call), it could be phrased "briefly down for maintenance" or "it's too popular, we'll be scaling up shortly" etc (since the error can well mean pg's "sorry, too many clients already" rather than true host unreachability). But not if unclear if it's that kind of error.