@@ -716,7 +716,9 @@ data HttpConfig = HttpConfig
716 -- @since 0.3.0
716 -- @since 0.3.0
717 httpConfigRetryJudge :: forall b. RetryStatus -> L.Response b -> Bool,
717 httpConfigRetryJudge :: forall b. RetryStatus -> L.Response b -> Bool,
718 -- | Similar to 'httpConfigRetryJudge', but is used to decide when to
718 -- | Similar to 'httpConfigRetryJudge', but is used to decide when to
719− -- retry requests that resulted in an exception.
719+ -- retry requests that resulted in an exception. By default it retries
720+ -- on response timeout and connection timeout (changed in version
721 -- @since 3.4.0
723 -- @since 3.4.0
722 httpConfigRetryJudgeException :: RetryStatus -> SomeException -> Bool,
724 httpConfigRetryJudgeException :: RetryStatus -> SomeException -> Bool,
@@ -750,7 +752,14 @@ defaultHttpConfig =
750 598, -- (Informal convention) Network read timeout error
752 598, -- (Informal convention) Network read timeout error
751 599 -- (Informal convention) Network connect timeout error
753 599 -- (Informal convention) Network connect timeout error
753− httpConfigRetryJudgeException = \_ _ -> False,
755+ httpConfigRetryJudgeException = \_ e ->
756+ case fromException e of
757+ Just (L.HttpExceptionRequest _ c) ->
759+ L.ResponseTimeout -> True
760+ L.ConnectionTimeout -> True
754 httpConfigBodyPreviewLength = 1024
763 httpConfigBodyPreviewLength = 1024