android-typed-errors

Implement typed Result<T, E> error handling across Android/KMP layers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill android-typed-errors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-typed-errors
Source: https://github.com/soygabimoreno/Los-ANDROIDES/tree/main/.agents/skills/android-typed-errors
Command: npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill android-typed-errors

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about android-typed-errors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle typed errors in Android and Kotlin Multiplatform projects?

Handle typed errors in Android and KMP by replacing exceptions with a generic Result<T, E> wrapper and a shared Error contract that propagates safely across data, domain, and presentation layers. This ensures compile-time error type safety.

What is the best way to standardize network error handling with Ktor HTTP responses?

Standardize Ktor HTTP network error handling by wrapping network calls in safe-call helpers that map HTTP responses and connectivity or serialization failures directly into a typed DataError.Network taxonomy within a Result.Error object.

How do I map domain errors to UI text in Android presentation layers?

Map domain errors to UI text in Android presentation layers by applying a UI mapping contract that converts user-facing typed failures into UiText, ensuring the presentation layer renders error messages cleanly and predictably.

Can I use functional chaining methods like map and fold with a Result wrapper?

You can use functional chaining methods like map, mapError, onSuccess, onFailure, fold, and asEmptyResult to transform and react to typed Result outcomes without breaking readability or relying on try-catch blocks.

Does this typed error approach work for both local database and network failures?

This typed error approach works for both local and network failures by using a shared domain error taxonomy, specifically DataError.Local and DataError.Network, to standardize disk, database, and HTTP data-layer exceptions into typed results.