Context
ADR-008 requires structural failures to be both logged persistently AND raised explicitly. Currently:
- mapping.py: 20 of 24 raises lack preceding
logger.error (3 validation methods were fixed)
- unfao.py: 3 of 7 raises lack preceding
logger.error (lines 65, 75, 225)
When exceptions are caught by batch handlers (which log at ERROR and continue), the original raise is NOT logged — the failure is both swallowed AND unrecorded.
Requirements
- Add
logger.error(err_msg) before each raise ValueError(err_msg) in both files
- This is a mechanical change — same pattern applied 23 times
- Follow the pattern already used in
_validate(): construct err_msg, log it, raise with it
Risk Register
C-19 (Tier 3). Part of Cluster B.
Note
If ADR-011 eliminates mapping.py from runtime, the 20 mapping.py raises become moot. The 3 unfao.py raises remain relevant regardless.
Context
ADR-008 requires structural failures to be both logged persistently AND raised explicitly. Currently:
logger.error(3 validation methods were fixed)logger.error(lines 65, 75, 225)When exceptions are caught by batch handlers (which log at ERROR and continue), the original raise is NOT logged — the failure is both swallowed AND unrecorded.
Requirements
logger.error(err_msg)before eachraise ValueError(err_msg)in both files_validate(): construct err_msg, log it, raise with itRisk Register
C-19 (Tier 3). Part of Cluster B.
Note
If ADR-011 eliminates mapping.py from runtime, the 20 mapping.py raises become moot. The 3 unfao.py raises remain relevant regardless.