errors
SKILL.md
Error Handling
Three Mechanisms
| Mechanism | When | Compiles Out? |
|---|---|---|
res_t |
IO, parsing, external failures | No |
assert() |
Preconditions, contracts | Yes (-DNDEBUG) |
PANIC() |
OOM, corruption, impossible states | No |
Decision Framework
- OOM? →
PANIC() - Can happen with correct code? →
res_t - Precondition/contract? →
assert() - Impossible state? →
PANIC()