result library
Classes
-
Failure<
T> - The unhappy path. Carries a structured NetworkException.
-
Result<
T> -
Sealed discriminated union for success / failure without exceptions escaping
the network layer. Inspired by Rust's
Result<T, E>. -
Success<
T> - The happy path. Carries the parsed response body.
Exceptions / Errors
- ConnectionException
- No network connectivity or DNS lookup failed.
- HttpStatusException
- Server responded, but with a non-2xx status code.
- NetworkException
- Root of all network-layer errors.
- ParseException
- The JSON body could not be decoded into the expected shape.
- TimeoutException
- The request exceeded its deadline.
- UnknownNetworkException
- Anything else that doesn't fit above.