Better ledger rejection error
Print a more understandable error message when a transaction is being rejected on ledger.
This commit is contained in:
parent
088bf56f2a
commit
405bfeddac
@ -3,6 +3,7 @@ package cli
|
|||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@ -152,7 +153,11 @@ var sendCmd = &cli.Command{
|
|||||||
|
|
||||||
sm, err := InteractiveSend(ctx, cctx, srv, proto)
|
sm, err := InteractiveSend(ctx, cctx, srv, proto)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
if strings.Contains(err.Error(), "no current EF") {
|
||||||
|
return xerrors.Errorf("transaction rejected on ledger: %w", err)
|
||||||
|
} else {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(cctx.App.Writer, "%s\n", sm.Cid())
|
fmt.Fprintf(cctx.App.Writer, "%s\n", sm.Cid())
|
||||||
|
Loading…
Reference in New Issue
Block a user