Skip to content

fix(cli): exit non-zero on admin info packed storage read failure#747

Closed
ebios-star wants to merge 2 commits intoentrius:testfrom
ebios-star:fix/admin-info-human-mode-exit-code
Closed

fix(cli): exit non-zero on admin info packed storage read failure#747
ebios-star wants to merge 2 commits intoentrius:testfrom
ebios-star:fix/admin-info-human-mode-exit-code

Conversation

@ebios-star
Copy link
Copy Markdown
Contributor

Summary

When _read_contract_packed_storage returns None in gitt admin info, JSON mode already exits 1 via emit_error_json + SystemExit, but human mode printed a yellow warning and exited 0 — the same class of JSON/human exit-code mismatch fixed for issues list --id in #724.

Consolidate both paths so they always raise SystemExit(1); JSON mode still emits the structured read_failed error payload, human mode still prints the friendly "try --verbose" hint.

Related Issues

N/A — follow-on to #724.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Added test_admin_info_human_mode_exits_non_zero_on_soft_read_failure next to the existing JSON-mode regression test.
  • uv run --extra dev pytest tests/ — all 430 tests pass.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

When `_read_contract_packed_storage` returns None, JSON mode already
exits 1 via emit_error_json + SystemExit, but human mode printed a
yellow warning and exited 0 — the same class of json/human exit-code
mismatch fixed in entrius#724 for `issues list --id`.

Consolidate both paths so they always raise SystemExit(1); JSON mode
still emits the structured error payload, human mode still prints the
friendly hint.

Add a regression test for the human-mode path alongside the existing
JSON-mode regression test.
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Apr 24, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 24, 2026

please provide screenshots of before and after this change in the cli

@andriypolanski
Copy link
Copy Markdown

Hi, @ebios-star , @anderdc
This pr is already mentioned in my pr #724.
Please check.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 24, 2026

Closing — asked on #746 to fold this fix in there. Same class of change, no reason to review twice.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants