← ClaudeAtlas

libutils-exceptionlisted

libutils exception handling (utils::exception) - IException/AException, Error/Warning/None/Fatal/CustomException, InternalCode vs ExternalCode, Type, restrictions, formated() output, throw/catch/print patterns - and how to add new exception codes to a project (cmake/config/exceptions/*.json, generate_exception_header.py + const.py, CMake custom command, include/exception/generated_external_exception_header.hpp). Use whenever throwing, catching or printing a libutils exception, choosing an exception code, or adding/editing exception codes, the exception JSON config, the generator script or the generated_*_exception_header of a project.
TsukiNi22/ai-utils · ★ 1 · Code & Development · score 74
Install: claude install-skill TsukiNi22/ai-utils
# libutils exceptions `<name>` (a skill) = the folder of that skill: `~/.claude/skills/<name>` (setup.sh) or `${CLAUDE_SKILL_DIR}/../../*/<name>` (plugin of the marketplace). Based on the libutils sources (`include/utils/exception/`, `src/utils/exception/AException.cpp`, `cmake/scripts/`), the wiki page *Exception (usage)* and the real setup of `context-forge`. Existing codes: `../libutils/reference/exception-codes.md` (the `libutils` skill). ## libutils freshness First, once per conversation: the freshness check of the `libutils` skill (`bash <libutils skill>/scripts/check.sh`, section "Freshness check" of `libutils/SKILL.md`). Outdated -> reuse the answer already given in this conversation, else ask once (continue / update the installed libutils with `libutils-install` / the project's requirement with `libutils-setup` / the skills reference) and remember it. ## 1. Classes All in `utils::exception`, always included by `<utils/utils.hpp>` with `#define _Exception` before it (never the exception headers one by one). | Class | Type set | Use | |---|---|---| | `IException` (interface, inherits `std::exception`) | - | **catch type** | | `AException` (abstract) | - | base of every exception, restriction check, `formated()` | | `ErrorException` | `Error` | recoverable error (most used) | | `WarningException` | `Warning` | printed, not thrown in general | | `NoneException` | `None` | not an error: exit / stop the flow (`InternalCode::Exit`) | | `FatalException` | `Error \| Fata