Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(autocounterd): fix ShortHelp, improve error messages #3504

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions misc/autocounterd/cmd/cmd_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewStartCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "start",
ShortUsage: "start [flags]",
ShortHelp: "Runs the linter for the specified packages",
ShortHelp: "Increments the counter in the specified realm at regular intervals",
},
cfg,
func(_ context.Context, args []string) error {
Expand All @@ -68,15 +68,15 @@ func execStart(cfg *startCfg, args []string, io commands.IO) error {

signer, err := gnoclient.SignerFromBip39(cfg.mnemonic, cfg.chainID, "", uint32(0), uint32(0))
if err != nil {
return err
return fmt.Errorf("failed to create signer: %w", err)
}
if err := signer.Validate(); err != nil {
return err
return fmt.Errorf("invalid signer: %w", err)
}

rpcClient, err := rpcclient.NewHTTPClient(cfg.rpcURL)
if err != nil {
return err
return fmt.Errorf("failed to create RPC client: %w", err)
}

client := gnoclient.Client{
Expand All @@ -97,7 +97,7 @@ func execStart(cfg *startCfg, args []string, io commands.IO) error {
})

if err != nil {
fmt.Printf("[ERROR] Failed to call Incr on %s, %+v\n", cfg.realmPath, err.Error())
fmt.Printf("[ERROR] Failed to call Incr on %s: %v\n", cfg.realmPath, err)
} else {
fmt.Println("[INFO] Counter incremented with success")
}
Expand Down
Loading