13eholder/modern-cpp-skills/m06-error-handling

Claude Code and agent skill by 13eholder/modern-cpp-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Mastering C++ Error Handling. Triggers: exceptions, try-catch, noexcept, std::expected, std::optional, error codes, assert, terminate.

Install

npx vskill@latest install 13eholder/modern-cpp-skills/m06-error-handling

SKILL.md

The same SKILL.md was published earlier as 13eholder/modern-cpp-skills/m06-error-handling.

C++ Error Handling

Core Question

Is this error recoverable?

  • Yes (Local): std::expected or return code.
  • Yes (Distant): Exceptions (throw).
  • No (Bug): assert or std::terminate.

Error → Design Question

IssueDesign Question
Uncaught ExceptionDid you forget to catch, or throw in noexcept?
Silent FailureDid you ignore a return code? (Use [[nodiscard]]).
Destructor ThrowNever throw from destructor (std::terminate).

Thinking Prompt

  1. Is absence valid?
  • Yes? → std::optional<T>.
  1. Does caller need details?
  • Yes? → std::expected<T, E> or Exception.
  • No? → bool or std::optional.
  1. Is it a Logic Error (Bug)?
  • Yes? → assert() or std::terminate(). Do not throw for bugs in C++ (Contract Violation).

Trace Up / Down

  • Trace Up:
  • Issue: "Program aborted with 'terminate called recursively'."
  • Cause: An exception was thrown while stack unwinding (in a destructor).
  • Fix: Fix the destructor. Ensure RAII cleanup is noexcept.

Quick Reference

MechanismCost (Happy)Cost (Sad)Use When
`std::optional`BranchBranchReturn may be empty.
`std::expected`BranchBranchRecoverable error (Parsing).
ExceptionZeroHugeRare IO/Resource errors.
AssertZero (Release)AbortLogic bugs / Invariants.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/13eholder/modern-cpp-skills/m06-error-handling/badge)](https://verified-skill.com/skills/13eholder/modern-cpp-skills/m06-error-handling)

Something wrong with this skill or its page? Tell us.