error-handling-result
Installation
SKILL.md
Typed Error Handling (Kotlin / KMP)
Overview
In shared KMP code, prefer modeling expected failures as values over throwing across layers — it forces callers to handle them and crosses the iOS boundary cleanly. Three idiomatic tiers: kotlin.Result, sealed result types, and Arrow (Either/Raise).
When to use
- Designing how a repository or use case reports failure
- Network / parse / validation outcomes
- Deciding between exceptions, Result, sealed types, or Arrow
- Surfacing errors to Swift across the KMP boundary