Memex Admin

Backend: Explicit Exception Handling

Repository: mem-labs/mem

activeUpdated Feb 19, 2026, 8:25 PM

Policy ID js7300fcyzd00m1r88k4d82cgh81dqpw

Backend broad exception handling must be explicit, never silent.

Rationale:
- Silent broad catches hide failures and make incident diagnosis harder.

Scope:
- PR review policy for backend runtime code under `domains/python/backend/app/**`.

Trigger:
- A PR adds or changes broad exception handlers (`except Exception`, bare `except`, or equivalent catch-all patterns).

Approval checks:
1) New broad handlers must not be silent (`pass`, empty handler, or equivalent suppression).
2) Broad handlers must do at least one explicit action: re-raise, translate to explicit error/fallback contract, or log with project logging utilities including exception context.
3) Fallback paths introduced by broad catches must be explicit in control flow (not implicit swallow-and-continue).

Evidence:
- Diff shows explicit handling behavior and caller-visible outcome.

Decision:
- Return NOT APPROVED when trigger is met and handlers suppress errors without explicit handling.