A pluggable sealed API result type for modeling Retrofit responses. By default, Retrofit uses exceptions to propagate any errors. This library leverages Kotlin sealed types to better model these responses with a type-safe single point of return and no exception handling needed. ApiResult has two sealed subtypes: Success and Failure. Success is typed to T with no error type and Failure is typed to E with no success type. Failure in turn is represented by four sealed subtypes of its own: Failure.NetworkFailure, Failure.ApiFailure, Failure.HttpFailure, and Failure.UnknownFailure. This allows for simple handling of results through a consistent, non-exceptional flow via sealed when branches.

Features

  • Plugability
  • Documentation available
  • Examples available
  • EitherNet ships with a Test Fixtures artifact containing a EitherNetController API to allow for easy testing with EitherNet APIs
  • You can optionally pass in full suspend functions if you need dynamic behavior
  • Java Interop

Project Samples

Project Activity

See All Activity >

Categories

Mobile

License

Apache License V2.0

Follow EitherNet

EitherNet Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of EitherNet!

Additional Project Details

Operating Systems

Android

Programming Language

Kotlin

Related Categories

Kotlin Mobile Software

Registered

2024-02-12