MCPcopy
hub / github.com/jackc/pgx / SafeToRetry

Function SafeToRetry

pgconn/errors.go:14–20  ·  view source on GitHub ↗

SafeToRetry checks if the err is guaranteed to have occurred before sending any data to the server.

(err error)

Source from the content-addressed store, hash-verified

12
13// SafeToRetry checks if the err is guaranteed to have occurred before sending any data to the server.
14func SafeToRetry(err error) bool {
15 var retryableErr interface{ SafeToRetry() bool }
16 if errors.As(err, &retryableErr) {
17 return retryableErr.SafeToRetry()
18 }
19 return false
20}
21
22// Timeout checks if err was caused by a timeout. To be specific, it is true if err was caused within pgconn by a
23// context.DeadlineExceeded or an implementer of net.Error where Timeout() is true.

Calls 1

SafeToRetryMethod · 0.45