[inconsistency] Consolidate error handling: anyhow vs NotfilesError across crates #6

Open
opened 2026-04-01 01:22:39 -05:00 by joe · 0 comments
Owner

Audit finding (medium): Error handling is split across crates:

  • notfiles / notcore: use Result<T, NotfilesError> with thiserror
  • nothooks, notsecrets, notstrap: use anyhow::Result

Worse, nothooks/src/runner.rs suppresses state load errors with .unwrap_or_default() while notfiles propagates them — hook state corruption is silently swallowed.

Options:

  1. Extend NotfilesError variants to cover hook/secret/bootstrap errors and migrate all crates
  2. Accept anyhow at the boundary crates (notstrap/nothooks/notsecrets) and reserve NotfilesError for notcore/notfiles only — document this explicitly

Either way, the silent .unwrap_or_default() in hook state loading should be replaced with a logged warning at minimum.

**Audit finding (medium):** Error handling is split across crates: - `notfiles` / `notcore`: use `Result<T, NotfilesError>` with `thiserror` - `nothooks`, `notsecrets`, `notstrap`: use `anyhow::Result` Worse, `nothooks/src/runner.rs` suppresses state load errors with `.unwrap_or_default()` while `notfiles` propagates them — hook state corruption is silently swallowed. **Options:** 1. Extend `NotfilesError` variants to cover hook/secret/bootstrap errors and migrate all crates 2. Accept anyhow at the boundary crates (notstrap/nothooks/notsecrets) and reserve `NotfilesError` for notcore/notfiles only — document this explicitly Either way, the silent `.unwrap_or_default()` in hook state loading should be replaced with a logged warning at minimum.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joe/notfiles#6