Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Sep 16, 2025

Macroscope is automatically generating a new summary of this pull request including the latest commits...

_Macroscope is automatically generating a new summary of this pull request including the latest commits..._

Fixes #1114

@mkysel mkysel requested a review from a team as a code owner September 16, 2025 19:29
@graphite-app
Copy link

graphite-app bot commented Sep 16, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@macroscopeapp
Copy link

macroscopeapp bot commented Sep 16, 2025

Silence CLI usage output and replace fatal process exits with error returns across xmtpd-cli commands, including setting a 15s context deadline in addRatesHandler

This change updates the xmtpd-cli to return errors instead of terminating the process and to suppress Cobra usage output on errors across admin, app-chain, key management, node registry, rate registry, settlement, and root commands. It also standardizes logger error wrapping and adjusts a context deadline to 15 seconds.

  • Replace log.Fatalf/logger.Fatal with returned errors and logger.Error across handlers in admin_setup.go, appchain.go, key_management.go, node_registry.go, rate_registry.go, and settlement.go.
  • Add SilenceUsage: true to parent and subcommands to suppress usage output on error in the same files.
  • Convert addRatesCommand to RunE and update addRatesHandler to return errors with a 15s context deadline in rate_registry.go.
  • Wrap errors with %w in cliLogger and hide the completion command in root.go.
  • Refine messages and targets (e.g., include app-chain-gateway) and return fmt.Errorf for invalid targets in relevant handlers.

📍Where to Start

Start with the CLI error-handling pattern changes in addRatesHandler and command RunE wiring in rate_registry.go, then review representative handler conversions in appchain.go and settlement.go.


Macroscope summarized d57cebe.

@mkysel mkysel merged commit e1920cc into main Sep 17, 2025
10 checks passed
@mkysel mkysel deleted the mkysel/silence-errors branch September 17, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI prints usage when command fails

3 participants