| ビジネスルール違反 | 引数の不正 (IllegalArgumentException) | | 外部システムエラー | 状態の矛盾 (IllegalStateException) | | 権限不足・リソース競合 | 到達不可コード (unreachable) |
| TypeScript | neverthrow | Result のみで十分な場合(軽量・シンプル) | | TypeScript | fp-ts | 関数型全般を使う場合(Option, Task, IO, Reader 等) | | JavaScript | neverthrow | TypeScript と同様 | | Rust | 標準 Result | 常にこれを使用。エラー定義には thiserror | | Go | 標準 (T, error) | Go らしいシンプルなコードを書く場合 | | Go | samber/mo | Result/Either でチェーン処理したい場合 | | Scala | 標準 Either[L, R] | 標準で十分。cats は大規模 FP 向け |
| Java | vavr.io Either | 関数型コレクションも使うなら vavr 一択 | | Python | returns (dry-python) | 本番環境向け。型アノテーション充実 | | Python | result | 軽量。Rust ライクなシンプルな API |
A skill for applying error-handling best practices. Helps design errors based on recoverability, use Either/Result types, and properly classify domain vs. system errors. Use during code reviews, new implementations, or refactoring when error-handling patterns need improvement. Target languages: Go, Rust, Scala, Java, TypeScript, JavaScript, Python. Triggered by error-handling-related requests such as “improve error handling,” “want to use Result types,” “review exception design,” or “design recoverable errors.” Source: j5ik2o/okite-ai.