-
Notifications
You must be signed in to change notification settings - Fork 563
improve error message in SendTransaction
json-rpc api
#786
Conversation
SendTransaction
json-rpc apiSendTransaction
json-rpc api
Codecov Report
@@ Coverage Diff @@
## main #786 +/- ##
==========================================
- Coverage 57.45% 57.30% -0.16%
==========================================
Files 71 71
Lines 6107 6041 -66
==========================================
- Hits 3509 3462 -47
+ Misses 2396 2377 -19
Partials 202 202
|
if err == nil { | ||
err = errors.New(rsp.RawLog) | ||
} | ||
if rsp != nil && rsp.Code != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&& is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it try to recover error from rsp
if rsp.Code != 0
.
if err == nil { | ||
err = errors.New(rsp.RawLog) | ||
} | ||
if rsp != nil && rsp.Code != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&& is correct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x/evm/keeper/utils.go
Outdated
@@ -28,7 +27,7 @@ func (k Keeper) DeductTxCostsFromUserBalance( | |||
// fetch sender account from signature | |||
signerAcc, err := authante.GetSignerAcc(ctx, k.accountKeeper, msgEthTx.GetFrom()) | |||
if err != nil { | |||
return nil, stacktrace.Propagate(err, "account not found for sender %s", msgEthTx.From) | |||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about adding additional info
account not found for sender..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, kept original error message with sdkerrors.Wrapf.
x/evm/keeper/utils.go
Outdated
"failed to deduct full gas cost %s from the user %s balance", | ||
fees, msgEthTx.From, | ||
) | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding addtional info
failed to deduct full gas cost %s from the user %s balance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept original error message with sdkerrors.Wrapf
.
94b52e8
to
ad87657
Compare
Closes: evmos#785 Solution: - Remove `stacktrace.Propagate`s, and recover error message in jsonrpc server changelog fix error messages
ad87657
to
77af78b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
* fix error message in `SendTransaction` json-rpc api Closes: #785 Solution: - Remove `stacktrace.Propagate`s, and recover error message in jsonrpc server changelog fix error messages * Update x/evm/keeper/msg_server.go Co-authored-by: Federico Kunze Küllmer <[email protected]> (cherry picked from commit c8d4d3f) # Conflicts: # CHANGELOG.md
* fix error message in `SendTransaction` json-rpc api Closes: #785 Solution: - Remove `stacktrace.Propagate`s, and recover error message in jsonrpc server changelog fix error messages * Update x/evm/keeper/msg_server.go Co-authored-by: Federico Kunze Küllmer <[email protected]> (cherry picked from commit c8d4d3f) # Conflicts: # CHANGELOG.md # app/ante/eth.go # go.mod # rpc/ethereum/namespaces/eth/api.go # x/evm/keeper/keeper.go # x/evm/keeper/state_transition.go
* fix error message in `SendTransaction` json-rpc api Closes: evmos#785 Solution: - Remove `stacktrace.Propagate`s, and recover error message in jsonrpc server changelog fix error messages * Update x/evm/keeper/msg_server.go Co-authored-by: Federico Kunze Küllmer <[email protected]>
Description
Closes: #785
Solution:
sdkerrors.Wrap
,since cosmos-sdk already support extract stacktrace in debug mode.
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)