Skip to content

Commit

Permalink
improve error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
fish-sammy committed Nov 13, 2023
1 parent 405455a commit e102532
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion x/nexus/keeper/general_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/query"

"github.com/axelarnetwork/axelar-core/utils"
Expand Down Expand Up @@ -244,5 +245,11 @@ func (k Keeper) RouteMessage(ctx sdk.Context, id string, routingCtx ...exported.
if len(routingCtx) == 0 {
routingCtx = []exported.RoutingContext{{}}
}
return k.getMessageRouter().Route(ctx, routingCtx[0], funcs.MustOk(k.GetMessage(ctx, id)))

msg := funcs.MustOk(k.GetMessage(ctx, id))
if err := k.getMessageRouter().Route(ctx, routingCtx[0], msg); err != nil {
return sdkerrors.Wrapf(err, "failed to route message %s to the %s module", id, msg.Recipient.Chain.Module)
}

return nil
}
2 changes: 1 addition & 1 deletion x/nexus/keeper/wasm_message_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type req struct {
func NewMessageRoute(nexus types.Nexus, account types.AccountKeeper, wasm types.WasmKeeper) exported.MessageRoute {
return func(ctx sdk.Context, _ exported.RoutingContext, msg exported.GeneralMessage) error {
if msg.Asset != nil {
return fmt.Errorf("asset is not supported")
return fmt.Errorf("asset transfer is not supported")
}

gateway := nexus.GetParams(ctx).Gateway
Expand Down

0 comments on commit e102532

Please sign in to comment.