mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 20:51:45 +00:00
Return errors from cmd functions instead of printing
This commit is contained in:
@ -215,8 +215,7 @@ func cmdAppendTx(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
txBytes, err := stringOrHexToBytes(c.Args()[0])
|
txBytes, err := stringOrHexToBytes(c.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
res := client.AppendTxSync(txBytes)
|
res := client.AppendTxSync(txBytes)
|
||||||
printResponse(c, res, string(res.Data), true)
|
printResponse(c, res, string(res.Data), true)
|
||||||
@ -231,8 +230,7 @@ func cmdCheckTx(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
txBytes, err := stringOrHexToBytes(c.Args()[0])
|
txBytes, err := stringOrHexToBytes(c.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
res := client.CheckTxSync(txBytes)
|
res := client.CheckTxSync(txBytes)
|
||||||
printResponse(c, res, string(res.Data), true)
|
printResponse(c, res, string(res.Data), true)
|
||||||
@ -254,8 +252,7 @@ func cmdQuery(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
queryBytes, err := stringOrHexToBytes(c.Args()[0])
|
queryBytes, err := stringOrHexToBytes(c.Args()[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
res := client.QuerySync(queryBytes)
|
res := client.QuerySync(queryBytes)
|
||||||
printResponse(c, res, string(res.Data), true)
|
printResponse(c, res, string(res.Data), true)
|
||||||
|
Reference in New Issue
Block a user