IsPermanent reports whether err wraps a sentinel that must NOT be retried (currently ErrCapabilityMissing and ErrAuthRequired).
(err error)
| 105 | // IsPermanent reports whether err wraps a sentinel that must NOT be retried |
| 106 | // (currently ErrCapabilityMissing and ErrAuthRequired). |
| 107 | func IsPermanent(err error) bool { |
| 108 | return errors.Is(err, ErrCapabilityMissing) || errors.Is(err, ErrAuthRequired) |
| 109 | } |
| 110 | |
| 111 | // wrap returns an error satisfying errors.Is for both sentinel and |
| 112 | // underlying, using Go 1.20+ multi-%w support. |
no outgoing calls