Swift Error Handling

Installation
SKILL.md

Swift Error Handling

Priority: P0

Implementation Guidelines

Throwing Functions

  • Propagate Errors: Use throws for recoverable errors.
  • Do-Catch: Handle errors close to source with specific catch blocks.
  • Error Types: Define custom errors as enums conforming to Error.

Result Type

  • Async Alternatives: Use Result<Success, Failure> for callback-based APIs.
  • Transformations: Use .map(), .flatMap() for functional composition.
  • Conversion: Use .get() to convert Result to throwing.

Never Type

Related skills
Installs
GitHub Stars
488
First Seen