Skip to content

utils: app-log-files and verified-file throw plain Error instead of AppError #1792

Description

@thymikee

Surfaced by #1781 B4 (PR #1790) while converting matcher-less assertions.

  • src/utils/app-log-files.ts:43 throws new Error(...)
  • src/utils/verified-file.ts:35 and :110 throw new Error(...)

The repo's typed-error rule (ADR-0010) is that failures are AppError with a code from the closed set in packages/kernel/src/errors.ts, so callers and tests can assert the reason rather than the message. These three sites can't be asserted by code today; src/daemon/__tests__/app-log.test.ts:39 had to fall back to a message regex.

Fix: pick the right code (COMMAND_FAILED / INVALID_ARGS as appropriate) and add a hint; then tighten the test in app-log.test.ts to assertThrowsAppError/assertRejectsAppError (helper added in #1790).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions