| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Fault.Http
Contents
Description
Shared HTTP fault classification for registry, queue, and advisory adapters.
Client exceptions become Ecluse.Core.Fault values at the adapter boundary. Neither a value nor
its rendering carries the request or the response: a header, a query a redirect reached, or a
cookie can carry a credential. Every manager the roles build starts from typedTlsManagerSettings,
so a failed body read raises a client exception too.
Synopsis
- classifyTransport :: HttpException -> TransportFault
- httpFault :: HttpException -> HttpFault
- isRetryableStatusCode :: Int -> Bool
- displayFaultT :: SomeException -> Text
- isClientFault :: SomeException -> Bool
- hostPortLabel :: Text -> Int -> Text
- typedBodyReads :: ManagerSettings -> ManagerSettings
- typedTlsManagerSettings :: ManagerSettings
Documentation
classifyTransport :: HttpException -> TransportFault Source #
Classify a client exception by type, reading text only for the socket error tls keeps as text. The detail is the dialled host:port and the client's own reason.
httpFault :: HttpException -> HttpFault Source #
The answered status, or else the transport fault classifyTransport assigns.
isRetryableStatusCode :: Int -> Bool Source #
Whether an HTTP status signals a temporary failure: server errors, timeout, or throttling.
displayFaultT :: SomeException -> Text Source #
An exception for a log line, without GHC's context. A client exception renders through renderHttpFault at the host:port it dialled, or by its reason alone without a request.
isClientFault :: SomeException -> Bool Source #
Whether displayFaultT renders the exception as an http-client fault, with a request or without one.
hostPortLabel :: Text -> Int -> Text Source #
A dialled host and port as a log line names them, so an IPv6 host keeps its brackets.
Managers
typedBodyReads :: ManagerSettings -> ManagerSettings Source #
Raise a socket or TLS failure in a response body read as the HttpException the client raises for one before the body.
typedTlsManagerSettings :: ManagerSettings Source #
tlsManagerSettings under typedBodyReads: every manager the roles build starts from this value.