Mastering C++ Error Handling. Triggers: exceptions, try-catch, noexcept, std::expected, std::optional, error codes, assert, terminate.
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. |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer