Skip to content

Make CLI error paths respect --json #4836

Description

@JSONbored

Problem: Several CLI commands share identical error-handling boilerplate that logs plain text and returns an exit code — but ignores the --json flag on exactly the failure path a monitoring wrapper needs structured output from.

Area: AMS / CLI

Proposal: Make the shared error-handling path check --json and emit a structured error object when set, consistent with each command's success-path output shape.

Deliverables:

  • A shared error-formatting helper used by every CLI command, respecting --json.

Acceptance criteria:

  • Running any affected command with --json against a failure case returns valid, parseable JSON describing the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions