Skip to content

Consolidate duplicated CLI handleError + friendlier server-down message #120

Description

@bharatsachya

Type: simplification / UX · Difficulty: medium

A near-identical handleError is copy-pasted across 5+ commands (IndexCommand.ts:75, IngestCommand.ts:115, StatsCommand.ts:101, LsCommand.ts:54, DeleteCommand.ts:67). When the server is down, a connection-refused/abort from fetch becomes HttpClientError("request failed: …") (httpClient.ts:37,56,70) and is printed verbatim — no hint that the daemon is not running.

Do: detect connection-refused/abort in httpClient and surface a friendly message (e.g. "could not reach bytebell-server on port X — is it running? try bytebell server"); extract the duplicated handleError into one shared helper.

Done when: one handleError is reused; server-down prints actionable guidance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions