算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
swift-error-handling【设计与创意】Standards for throwing functions, Result type, and Never. Use when implementing Swift error throwing, designing error hierarchies, using Result types, or adding do-catch blocks.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Errorthrows (or async throws)do-catch at call site with specific catch clausesthrows for recoverable errors and async throws for modern concurrency.catch: last resort.Error:See implementation examples for custom error enums, do-catch patterns, and Result type usage.
try? only for non-critical errors where nil acceptable.throws for synchronous code. Use Result for callbacks and non-async deferred error states..map(), .flatMap() for functional composition..get() to convert Result to throwing for use in try-catch.Never return type only for unrecoverable crash scenarios or to indicate unreachable code. Never for expected errors.precondition(), assert(), and fatalError() for programmer errors. Use assertionFailure() for debug-only checks.try? or do-catch.When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant: