Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AttemptedTLSWithNonTLSBackend = ClassifierFunc(func(err error) bool { switch err.(type) { case tls.RecordHeaderError, *tls.RecordHeaderError: return true default: return false } })
View Source
var ConnectionResetOnRead = ClassifierFunc(func(err error) bool { ne, ok := err.(*net.OpError) return ok && ne.Op == "read" && ne.Err.Error() == "read: connection reset by peer" })
View Source
var ContextCancelled = ClassifierFunc(func(err error) bool { return err == context.Canceled })
View Source
var Dial = ClassifierFunc(func(err error) bool { ne, ok := err.(*net.OpError) return ok && ne.Op == "dial" })
View Source
var FailableClassifiers = RetriableClassifiers
View Source
var HostnameMismatch = ClassifierFunc(func(err error) bool { switch err.(type) { case x509.HostnameError, *x509.HostnameError: return true default: return false } })
View Source
var PrunableClassifiers = ClassifierGroup{ HostnameMismatch, AttemptedTLSWithNonTLSBackend, }
View Source
var RemoteFailedCertCheck = ClassifierFunc(func(err error) bool { ne, ok := err.(*net.OpError) return ok && ne.Op == "remote error" && ne.Err.Error() == "tls: bad certificate" })
View Source
var RemoteHandshakeFailure = ClassifierFunc(func(err error) bool { ne, ok := err.(*net.OpError) return ok && ne.Op == "remote error" && ne.Err.Error() == "tls: handshake failure" })
View Source
var RetriableClassifiers = ClassifierGroup{ AttemptedTLSWithNonTLSBackend, Dial, ConnectionResetOnRead, RemoteFailedCertCheck, RemoteHandshakeFailure, HostnameMismatch, UntrustedCert, }
View Source
var UntrustedCert = ClassifierFunc(func(err error) bool { switch err.(type) { case x509.UnknownAuthorityError, *x509.UnknownAuthorityError: return true default: return false } })
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type ClassifierFunc ¶
func (ClassifierFunc) Classify ¶
func (f ClassifierFunc) Classify(err error) bool
type ClassifierGroup ¶
type ClassifierGroup []Classifier
func (ClassifierGroup) Classify ¶
func (cg ClassifierGroup) Classify(err error) bool
Classify returns true on errors that are retryable
Click to show internal directories.
Click to hide internal directories.