cli: add ExitError where needed

This commit is contained in:
Anna Shaleva 2020-11-03 14:08:59 +03:00
parent b8a88f9378
commit 2f9d64821f
4 changed files with 9 additions and 9 deletions

View file

@ -80,7 +80,7 @@ func signMultisig(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
res, err := c.SendRawTransaction(tx) res, err := c.SendRawTransaction(tx)
if err != nil { if err != nil {

View file

@ -156,7 +156,7 @@ func getNEP5Balance(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
err = c.Init() err = c.Init()
if err != nil { if err != nil {
@ -271,7 +271,7 @@ func importNEP5Token(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
tok, err := c.NEP5TokenInfo(tokenHash) tok, err := c.NEP5TokenInfo(tokenHash)
@ -364,7 +364,7 @@ func multiTransferNEP5(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
err = c.Init() err = c.Init()
if err != nil { if err != nil {
@ -431,7 +431,7 @@ func transferNEP5(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
err = c.Init() err = c.Init()
if err != nil { if err != nil {

View file

@ -95,7 +95,7 @@ func handleCandidate(ctx *cli.Context, method string) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
gas := flags.Fixed8FromContext(ctx, "gas") gas := flags.Fixed8FromContext(ctx, "gas")
@ -152,7 +152,7 @@ func handleVote(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
var pubArg interface{} var pubArg interface{}

View file

@ -230,7 +230,7 @@ func claimGas(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
neoContractHash, err := c.GetNativeContractHash("neo") neoContractHash, err := c.GetNativeContractHash("neo")
@ -426,7 +426,7 @@ func importDeployed(ctx *cli.Context) error {
c, err := options.GetRPCClient(gctx, ctx) c, err := options.GetRPCClient(gctx, ctx)
if err != nil { if err != nil {
return err return cli.NewExitError(err, 1)
} }
cs, err := c.GetContractStateByHash(h) cs, err := c.GetContractStateByHash(h)