error-handling
TypeScript、Python、Goにわたる堅牢なエラー処理のパターン。型付きエラー、エラー境界、リトライ、サーキットブレーカー、ユーザー向けエラーメッセージをカバーします。
Original · translation did not pass checksTarget: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Japanese text
Topics in the source
- エラー処理パターン
- アクティベートするタイミング
- コア原則
- TypeScript / JavaScript
- 型付きエラークラス
- Resultパターン(スロー不使用スタイル)
- APIエラーハンドラー(Next.js / Express)
- ReactエラーバウンダリーII
本番アプリケーション向けの一貫した堅牢なエラー処理パターン。 新しいモジュールやサービスのエラー型や例外階層を設計する場合 信頼性の低い外部依存関係に対してリトライロジックやサーキットブレーカーを追加する場合 APIエンドポイントでエラー処理の欠落をレビューする場合 ユーザー向けエラーメッセージとフィードバックを実装する場合 カスケード障害やサイレントなエラー飲み込みをデバッグする場合 1. 早く大きく失敗する — エラーが発生した境界で表面化させる。埋め込まない 2. 文字列メッセージより型付きエラー — エラーは構造を持つファーストクラスの値 3. ユーザーメッセージ ≠ 開発者メッセージ — ユーザーには親しみやすいテキストを表示し、詳細なコンテキストはサーバー側でログに記録する 4. エラーをサイレントに飲み込まない — すべてのcatchブロックは処理、再スロー、またはログのいずれかを行う必要がある 5. エラーはAPIコントラクトの一部 — クライアントが受け取る可能性があるすべてのエラーコードをドキュメント化する 失敗が想定され一般的な操作(パース、外部呼び出し)向け: エラーコードを人間が読めるメッセージにマッピングする。技術的な詳細はユーザーに見えるテキストに含めない。 エラー処理に触れるコードをマージする前に: [ ] すべてのcatchブロックが処理、再スロー、またはログを行っている — サイレントな飲み込みなし [ ] APIエラーが標準エンベロープ{ error: { code, message } }に従っている [ ] ユーザー向けメッセージにスタックトレースや内部詳細が含まれていない [ ] サーバー側で完全なエラーコンテキストがログに記録されている [ ] カスタムエラークラスがcodeフィールドを持つ基底AppErrorを継承している [ ] 非同期関数がエラーを呼び出し元に伝播している — フォールバックなしの fire-and-forget なし [ ] リトライロジックがリトライ可能なエラーのみをリトライしている(4xxクライアントエラーはリトライしない) [ ] ReactコンポーネントがレンダリングエラーのためにErrorBoundaryでラップされている
- Source repository
- affaan-m/ECC
- Source file
- docs/ja-JP/skills/error-handling/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.196Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.