Skip to content

Logger.throw() exposes unusual contract in public API #438

@nam-hle

Description

@nam-hle

Problem

The `Logger` interface (`logger.ts:44`) includes a `throw()` method in the public API:

throw(message: InputLogObject | string, ...args: unknown[]): never;

This mixes logging concerns with error-throwing control flow. Task authors who receive a `Logger` via `RunnerContext` may be confused by a logger that throws errors.

Impact

  • Unconventional API — most logging libraries don't include error-throwing
  • Muddles the responsibility boundary between logging and error handling
  • May surprise users writing custom tasks

Suggested Approach

Consider separating the error-throwing capability from the Logger interface, or at minimum documenting the intended usage clearly in the public API docs.

Found during architectural review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    benefit: lowCode hygiene, minor polish, future-proofingeffort: medium1-4 hours, multiple files or moderate complexitypriority: lowMinor impact, few users, non‑urgenttype: refactorCode cleanup or restructuring without changing external behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions