Skip to content

[Task] Harden error messages and address parsing for diagnosability #12

@crrow

Description

@crrow

Goal

Improve error quality and input validation for network/address and low-level error paths to make failures diagnosable and user-friendly.

Scope

In scope:

  • pkg/xev/tcp.go (address parsing)
  • pkg/cxev/tcp.go (TCPError formatting)
  • pkg/cxev/udp.go (UDPError formatting)
  • pkg/cxev/file.go (FileError formatting)
  • README/API docs examples impacted by behavior changes
  • tests

Out of scope:

  • introducing a full custom error type hierarchy for every package

Problem Statement

Current error rendering and parsing paths can yield low-fidelity diagnostics (e.g., rune-converted error codes, permissive port parsing). This slows debugging and weakens usability.

Definition of Done

  • Error messages include actionable numeric/context details.
  • Address parser rejects invalid/non-numeric/out-of-range ports.
  • Add tests for representative invalid inputs and error formatting.
  • Sync docs/examples with current API signatures where needed.
  • just check passes.
  • just test-quick passes.

Verification Commands

just check
just test-quick
go test ./pkg/xev ./pkg/cxev -run 'Parse|Error' -count=1

Worktree Branch Name

codex/issue-4-error-and-parse-hardening

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High: important for MVP qualityenhancementNew feature or requestmvpTracks current MVP milestone scopestabilityReliability and correctness improvementssubagentSubagent execution tasktoken-SSmall token budget taskwave-1Execution wave 1

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions