Module classify
Expand description
What a runner does next, stated by the error that stopped it (SY-36).
§Why the class is on the error
SyncPeer::Error is bounded on Classify, so
every error a peer reports says which of five remedies applies. The
alternative that lost was a method on the peer,
fn classify(&self, error: &Self::Error) -> FailureClass. It works only
while the peer is in hand, and an error does not stay beside its peer: a
runner logs it, boxes it into a report, and carries it across an .await
after the handle is gone, which SY-16 makes the normal way an edge ends. A
bound on the associated type makes the class travel with the value — the
placement ADR-0009 chose for an error’s thread-safety, for the same reason.
The other two alternatives were rejected in ADR-0026: an opaque error, which a runner can treat only one way, and a runner-side table from error type to class, which cannot be written because one HTTP status type is a stop at 401, a split at 413 and a retry at 503.
§No Send, and object-safe
One &self method and no generics, so &dyn Classify works and the Durable
Object’s Rc-holding error implements it unchanged. A Send bound here
would undo the measurement on SyncPeer::Error.
Enums§
- Failure
Class - The remedy a failure calls for. One of five, the fifth added by SY-32.
Traits§
- Classify
- An error that states its
FailureClass.