CallStatus
call { } returns a CallStatus.Result, which tells apart every way a call can end.
This page covers its cases and the functions that read them.
| Case | Meaning |
|---|---|
|
The endpoint answered |
|
The endpoint answered |
|
The server answered any other non-success status. |
|
The request never reached the server. |
CallStatus additionally carries a Loading state, so the same type also models a call still in flight in a UI (see Flows).
Two kinds of throwable are deliberately not folded into a result.
A CancellationException raised mid-call propagates unchanged, so cancelling the caller’s scope still cancels it.
The client-misconfiguration exceptions of Configuring the HttpClient propagate too, since retrying or handling them as a NetworkFailure would never fix what is actually wrong.
Reading one
| Function | Behaviour |
|---|---|
|
The success value, or |
|
Transforms the success/failure payload, passing every other case through unchanged. |
|
Widens a |