Skip to content

[BUG] Issue CLI logical failure paths return exit code 0 (admin/vote/harvest) #706

@bitloi

Description

@bitloi

Description

Several issue CLI commands print error messages for logical failure branches but still exit with status code 0.
This causes scripts/CI to treat failed operations as success.

Affected command surfaces include:

  • admin cancel-issue (issue not found, cancel result false)
  • admin payout-issue (issue not found, payout result false)
  • admin set-owner (result false)
  • admin set-treasury (result false)
  • admin add-vali (result false)
  • admin remove-vali (result false)
  • vote solution (result false)
  • vote cancel (result false)
  • harvest (failed/partial/None-style non-success outcomes)

Steps to Reproduce

  1. Run one of the affected commands in a logical failure path (example: gitt admin cancel-issue <nonexistent_issue_id>).
  2. Observe that an error is printed (for example: Issue <id> not found on contract.).
  3. Check shell exit code (echo $?) and observe it is 0.

Expected Behavior

Logical command failures should exit non-zero (exit code != 0) so automation can detect failures reliably.

Actual Behavior

CLI prints failure/error output but returns exit code 0 for multiple logical-failure branches.

Environment

  • OS: Linux (Ubuntu)
  • Python version: 3.12.x
  • Commit/Version: test branch (e.g. 4d47116 before fix)

Additional Context

This is inconsistent with existing exception failure handling in the same CLI, where _handle_command_error / handle_exception already exit non-zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions