2
0

Merge remote-tracking branch 'pgconn/master' into v5-dev

This commit is contained in:
Jack Christensen
2022-07-12 06:45:54 -05:00
6 changed files with 165 additions and 24 deletions
+17
View File
@@ -202,3 +202,20 @@ func redactURL(u *url.URL) string {
}
return u.String()
}
type NotPreferredError struct {
err error
safeToRetry bool
}
func (e *NotPreferredError) Error() string {
return fmt.Sprintf("standby server not found: %s", e.err.Error())
}
func (e *NotPreferredError) SafeToRetry() bool {
return e.safeToRetry
}
func (e *NotPreferredError) Unwrap() error {
return e.err
}