本文へスキップ
Skillpedia
一般的なプログラミング75k · #2833

error-handling

できること

このスキルは、特に非同期の処理や React のコンポーネントで、コードがエラーをどう扱っているかをレビューします。アプリが穏やかに失敗し、デバッグしやすくなってほしい開発者向けです。

使う場面

  • ✓エラーの後でアプリがクラッシュしたり、真っ白になったりするとき。
  • ✓非同期のリクエストが失敗しても、メッセージやログがないとき。
  • ✓React のアプリで、エラーを画面の一部に閉じ込めたいとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/error-handling/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/error-handling/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“エラーが適切に処理されているか、コードをレビューしてもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、try-catch ブロックのない非同期の処理と、静かに無視されているエラーを探します。それらを捕まえて、役立つ文脈をログに残し、React ではエラーバウンダリを追加することを提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Implement proper error handling

Unhandled errors crash applications, create poor user experiences, and make debugging impossible without proper context.

Quick Reference

  • Wrap async operations in try-catch blocks
  • Use Error Boundaries in React for UI-level error handling
  • Log errors with context for debugging
  • Always re-throw or handle—never silently swallow errors

Check

Review error handling in this code, ensuring async operations use try-catch and errors are properly logged.

Fix

Add try-catch blocks to async operations and implement error boundaries for React components.

Explain

Explain JavaScript error handling best practices including try-catch, Promise rejection, and error boundaries.

Code Review

Review scripts, client components, and browser execution paths related to Implement proper error handling. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/javascript/error-handling

よくある質問

エラーバウンダリとは何ですか?

React で、子のコンポーネントのエラーを捕まえて、画面全体を壊す代わりに代替の表示を出すコンポーネントです。

エラーを無視してもよいですか?

このスキルは、エラーを黙って握りつぶさないよう勧めています。各エラーは処理されるか、上に渡される必要があります。

Promise の拒否も確認しますか?

はい。このスキルは、処理されていない Promise の拒否もエラー処理の一部として扱います。

詳細

作者による元の説明

Use when reviewing scripts, client components, bundles, or runtime behavior related to Implement proper error handling. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2833
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル