Skip to content

ADR-008 compliance: add log-before-raise to remaining raises (C-19) #13

@Polichinel

Description

@Polichinel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions