We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
checkResponse
1 parent 593f1e9 commit d02c11bCopy full SHA for d02c11b
http.go
@@ -76,6 +76,15 @@ func permanentErrorCode(c int) bool {
76
c == http.StatusNotImplemented
77
}
78
79
+// checkResponse checks the HTTP response for retryable errors.
80
+//
81
+// Temporary errors are returned as an error and are therefore retried.
82
83
+// Permanent errors are *not* returned as an error and are therefore *not* retried.
84
+// An argument could be made to return them as a permanent error, too.
85
+// However, this would mean a significant diversion from the standard net/http semantic.
86
87
+// If err is not nil, it is wrapped in permanentError and returned.
88
func checkResponse(res *http.Response, err error) error {
89
if err != nil {
90
if _, ok := err.(Error); ok {
0 commit comments