Skill Wiki v0.1.0
rule @ios-swift/rule-error-throws-not-result-where-possible

Error Throws Not Result Where Possible

Swift has two error-handling shapes: throwing functions (`func f() throws -> T`, `func f() async throws -> T`) and `Result<Success, Failure>`.…

Skill
@ios-swift
Domain
ios-swift
Version
0.1.0
Quality
4.0
Edges
3 out · 3 in
Tokens
166/341/367
$ prime install @ios-swift/rule-error-throws-not-result-where-possible

Projection

Always in _index.xml · the agent never has to ask for this.

ErrorThrowsNotResultWherePossible [rule] v0.1.0

Swift has two error-handling shapes: throwing functions (func f() throws -> T, func f() async throws -> T) and Result<Success, Failure>. The throwing form is the language-level mechanism — it integrates with try/catch, with async/await, and with typed-throws (Swift 6). Use it for any function whose call site immediately handles or propagates the error. Reserve Result for cases where the error must be stored alongside the value: callback bridges that cannot be made async, completion handlers from older APIs, or stream events that emit successes and failures over time.

Source

prime-system/examples/ios-swift/primes/compiled/@ios-swift/rule-error-throws-not-result-where-possible/atom.yaml

Compiled at 2026-05-10