pub enum Failure {
Unreachable(String),
TimedOut(i64),
BadResponse(String),
Stopped,
}Expand description
Why no reply came back.
Three of these are the peer’s doing and one is the caller’s, which is the distinction worth
keeping: a program that asked and did not get an answer has a failure to handle, and a program
whose scope stopped wanting the answer has nothing to handle at all. A fifth that said
“something went wrong” would be a Str with extra steps.
Variants§
Unreachable(String)
Connect or write failed, or nothing is listening.
TimedOut(i64)
The exchange did not finish inside the deadline the implementation was given.
BadResponse(String)
Bytes arrived and were not an HTTP response.
Stopped
The caller stopped wanting the reply — Stop::asked became true while the exchange was
in flight.
Not a failure of the request, and a caller that installed a Stop is expected to notice
this before it renders anything: beck-eval turns it back into the cancellation it came
from. crate::host::failure_value renders it as HttpUnreachable if one ever reaches a
program, because HttpError is a published union and a fourth variant would be a wire
change made for a case no program can observe.