Skip to content

Commit

Permalink
Display error messages more properly.
Browse files Browse the repository at this point in the history
Removed MAMA
  • Loading branch information
abourget committed Nov 28, 2018
1 parent dfa80d7 commit ed1856d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 12 additions & 2 deletions eosc/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,13 @@ func optionallyPushTransaction(signedTx *eos.SignedTransaction, packedTx *eos.Pa

func pushTransaction(api *eos.API, packedTx *eos.PackedTransaction, chainID eos.SHA256Bytes) {
resp, err := api.PushTransaction(packedTx)
errorCheck("pushing transaction", err)
if err != nil {
if typedErr, ok := err.(eos.APIError); ok {
printError(typedErr)
}
errorCheck("pushing transaction", err)
}

//fmt.Println("Transaction submitted to the network. Confirm at https://eosq.app/tx/" + resp.TransactionID)
trxURL := transactionURL(chainID, resp.TransactionID)
fmt.Printf("\nTransaction submitted to the network.\n %s\n", trxURL)
if resp.BlockID != "" {
Expand Down Expand Up @@ -257,6 +261,12 @@ func blockURL(chainID eos.SHA256Bytes, blockID string) string {
return blockID
}

func printError(err eos.APIError) {
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
enc.Encode(err)
}

func yamlUnmarshal(cnt []byte, v interface{}) error {
jsonCnt, err := yaml2json.Convert(cnt)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions eosc/cmd/msigPropose.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ Pass --requested-permissions
return el1.Permission < el2.Permission
})

fmt.Println("MAMA", requested)

pushEOSCActions(api,
msig.NewPropose(proposer, proposalName, requested, tx),
)
Expand Down

0 comments on commit ed1856d

Please sign in to comment.