m06-error-handling/SKILL.md
Mastering C++ Error Handling. Triggers: exceptions, try-catch, noexcept, std::expected, std::optional, error codes, assert, terminate.
npx skillsauth add 13eholder/modern-cpp-skills m06-error-handlingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Is this error recoverable?
std::expected or return code.throw).assert or std::terminate.| Issue | Design Question |
| ---------------------- | ---------------------------------------------------- |
| Uncaught Exception | Did you forget to catch, or throw in noexcept? |
| Silent Failure | Did you ignore a return code? (Use [[nodiscard]]). |
| Destructor Throw | Never throw from destructor (std::terminate). |
Is absence valid?
std::optional<T>.Does caller need details?
std::expected<T, E> or Exception.bool or std::optional.Is it a Logic Error (Bug)?
assert() or std::terminate(). Do not throw for bugs in C++ (Contract Violation).noexcept.| Mechanism | Cost (Happy) | Cost (Sad) | Use When |
| ------------------- | -------------- | ---------- | ---------------------------- |
| std::optional | Branch | Branch | Return may be empty. |
| std::expected | Branch | Branch | Recoverable error (Parsing). |
| Exception | Zero | Huge | Rare IO/Resource errors. |
| Assert | Zero (Release) | Abort | Logic bugs / Invariants. |
tools
Common C++ Anti-Patterns. Triggers: global variables, new/delete, C-style cast, macros, void*.
data-ai
C++ Mental Models: Pointer vs Reference, Initialization, Undefined Behavior.
data-ai
Mastering C++ Domain Errors: Exception Hierarchies, System Errors, and Expected.
data-ai
Mastering C++ Lifecycle: RAII, Destructors, Static Initialization, Rule of 5.