Skip to content

Commit

Permalink
chore(autocounterd): fix ShortHelp, improve error messages (#3504)
Browse files Browse the repository at this point in the history
Per title.
  • Loading branch information
mdqst authored Jan 15, 2025
1 parent 1ff162b commit 3fa9940
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 3fa9940

Please sign in to comment.