error-handling
改善應用程式中的錯誤處理
薄弱的錯誤處理會隱藏失敗,並向使用者暴露技術性訊息。這項技能會引導 Claude、Codex 和 Claude Code 採用更安全的復原模式。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "error-handling" from https://skillstore.io/skills/doyajin174-error-handling.md and its manifest at https://skillstore.io/api/skills/doyajin174-error-handling/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「error-handling」。 資料載入器在請求失敗時讓頁面一片空白。
預期結果:
- 新增 catch 路徑,用來儲存錯誤狀態並記錄失敗。
- 顯示含重試操作的使用者安全訊息。
- 在可能時回傳快取或空的備援資料。
正在使用「error-handling」。 React 儀表板在某個圖表擲出錯誤時當機。
預期結果:
- 將圖表區域包在範圍化的 Error Boundary 中。
- 顯示圖表專屬的備援畫面,而不是取代整個頁面。
- 將擷取到的錯誤和元件內容傳送到追蹤服務。
正在使用「error-handling」。 應用程式向使用者顯示原始技術錯誤。
預期結果:
- 將內部錯誤代碼對應到清楚的使用者訊息。
- 只在開發者記錄中保留 stack traces。
- 對非預期失敗使用預設訊息。
安全審計
中風險The static command findings are false positives from Markdown fences and TypeScript or TSX template literals. The hardcoded URLs are documentation references, and NODE_ENV access is a non-secret sample check. One semantic issue remains because the community skill grants Bash without a demonstrated need.
已確認的安全問題 (1)
風險因素
⚙️ 外部命令 (25)
🌐 網路存取 (2)
🔑 環境變數 (2)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/doyajin174-error-handling/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/doyajin174-error-handling?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/doyajin174-error-handling?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/doyajin174-error-handling/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/doyajin174-error-handling.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
Doyajin174. (2026). error-handling security audit report (audit version 8) [Author version 1.0]. Skillstore. https://skillstore.io/skills/doyajin174-error-handling/audits/8BibTeX 引用
@techreport{doyajin174-doyajin174-error-handling-2026,
author = {Doyajin174},
title = {error-handling security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/doyajin174-error-handling/audits/8},
note = {Author version 1.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "error-handling security audit report (audit version 8)"
version: "1.0"
type: report
authors:
- name: "Doyajin174"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/doyajin174-error-handling/audits/8"
identifiers:
- type: other
value: "skillstore:doyajin174-error-handling:audit:8"
description: "Skillstore immutable audit report identifier"
比較變體
2 個可安裝變體每位作者的技能都保留為獨立的可安裝項目。推薦變體依 Skillstore 證據排序。
為何此變體排名第一
doyajin174-error-handling
2026-09-09
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
強化 API 呼叫
檢查請求程式碼是否缺少 catch 路徑、使用者安全訊息和備援行為。
新增 React 邊界
規劃 Error Boundaries 的放置位置,讓單一元件失敗不會破壞整個應用程式。
標準化錯誤回應
為團隊程式碼庫建立一致的錯誤類別、訊息對應表和記錄規則。
試試這些提示
檢視這個 async function 是否缺少錯誤處理。建議 try-catch、使用者回饋、記錄和簡單備援方案。
稽核這個 API 呼叫流程。區分網路、未找到、驗證、驗證失敗和非預期錯誤,並搭配使用者安全訊息。
針對這個 React 畫面建議 Error Boundary 放置方式。包含元件失敗時的 fallback UI 行為和記錄。
設計應用程式錯誤處理策略。涵蓋自訂錯誤類型、訊息對應、優雅降級、遙測和檢查清單項目。
最佳實務
- 在使用通用備援路徑之前,先分別處理預期的錯誤類型。
- 為開發者記錄足夠的內容,同時向使用者顯示簡單的復原指引。
- 使用範圍化備援,讓單一功能失敗不會破壞整個畫面。
避免
- 不要留下空的 catch 區塊,或默默忽略 rejected promises。
- 不要向最終使用者顯示 stack traces 或原始例外訊息。
- 當較小的備援方案可以保留可用內容時,不要讓整個頁面失敗。
常見問題
這項技能會自動撰寫生產環境錯誤處理程式碼嗎?
它聚焦於哪些語言?
它能協助處理 React Error Boundaries 嗎?
它涵蓋面向使用者的錯誤訊息嗎?
它會設定錯誤追蹤工具嗎?
團隊在採用前應審查什麼?
開發者詳細資訊
作者
Doyajin174授權
MIT
作者版本
v1.0
Skillstore 修訂
r1
版本提示
作者聲明的版本不符合 SemVer 規範。
引用
72d5025b022c77f7a51bdf5c1637c689c80e89d1
維護新鮮度
2026/7/21
使用量
6 次下載 · 271 次瀏覽
檔案結構
📄 SKILL.md