What problem does it solve?
This Skill solves the problem of inconsistent and fragile error handling by providing a consistent typed Result pattern and shared error model that travels cleanly across Android and KMP layers.
Core Features & Use Cases
- Typed Result wrapper: Use Result<T, E> to represent success and failure with a compile-time error type instead of relying on exceptions.
- Extension helpers for functional chaining: Use map, mapError, onSuccess, onFailure, fold, and asEmptyResult to transform and react to outcomes without breaking readability.
- Shared domain error taxonomy: Use DataError (Network and Local) as a common, reusable supertype for data-layer failures.
- Layered exception philosophy: Catch exceptions at the responsible layer (data/domain/presentation) and map them into typed errors for upper layers.
- UI mapping contract: Convert user-facing errors into UiText so presentation stays clean and predictable.
- HTTP safe call helpers: Wrap network calls and map HTTP responses and connectivity/serialization failures into DataError.Network.*.
Quick Start
Apply the android-typed-errors pattern to a repository function by returning Result<T, E> with a domain-specific error type and chaining onSuccess/onFailure to update UI state or show a mapped UiText message.