Skip to content

Commit

Permalink
chore(imp) improve cli error messages (backport cosmos#7) (cosmos#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
  • Loading branch information
mergify[bot] and GAtom22 authored Feb 23, 2023
1 parent 8d3bcd3 commit 691e707
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion baseapp/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newOutOfGasRecoveryMiddleware(gasWanted uint64, ctx sdk.Context, next recov

return sdkerrors.Wrap(
sdkerrors.ErrOutOfGas, fmt.Sprintf(
"out of gas in location: %v; gasWanted: %d, gasUsed: %d",
"out of gas in location: %v; gasWanted: %d, gasUsed: %d. Please retry with a gas (--gas flag) amount higher than gasUsed",
err.Descriptor, gasWanted, ctx.GasMeter().GasConsumed(),
),
)
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
switch rType := r.(type) {
case sdk.ErrorOutOfGas:
log := fmt.Sprintf(
"out of gas in location: %v; gasWanted: %d, gasUsed: %d",
"out of gas in location: %v; gasWanted: %d, gasUsed: %d. Please retry with a gas (--gas flag) amount higher than gasUsed",
rType.Descriptor, gasTx.GetGas(), newCtx.GasMeter().GasConsumed())

err = sdkerrors.Wrap(sdkerrors.ErrOutOfGas, log)
Expand Down

0 comments on commit 691e707

Please sign in to comment.