Skip to content

Commit

Permalink
review feedback: cli: wrap hex decoding errors to indicate which argu…
Browse files Browse the repository at this point in the history
…ment could not be decoded
  • Loading branch information
evan-forbes committed Feb 25, 2021
1 parent e15b95b commit db5a91c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/lazyledgerapp/client/cli/payformessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"encoding/hex"
"errors"
"fmt"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -40,13 +41,13 @@ func CmdCreatePayForMessage() *cobra.Command {
// decode the namespace
namespace, err := hex.DecodeString(args[0])
if err != nil {
return err
return fmt.Errorf("failure to decode hex namespace: %s", err)
}

// decode the message
message, err := hex.DecodeString(args[1])
if err != nil {
return err
return fmt.Errorf("failure to decode hex message: %s", err)
}

// create the PayForMessage
Expand Down

0 comments on commit db5a91c

Please sign in to comment.