Skip to content

Commit

Permalink
inmprove error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Aug 1, 2024
1 parent 8a262fc commit f8e105b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x/claim/keeper/msg_server_claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper
import (
"context"

"cosmossdk.io/collections"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/ignite/modules/pkg/errors"
Expand All @@ -23,7 +24,9 @@ func (k msgServer) Claim(ctx context.Context, msg *types.MsgClaim) (*types.MsgCl

// check if the claim is an initial claim
initialClaim, err := k.InitialClaim.Get(ctx)
if err == nil {
if err != nil && errors.IsOf(err, collections.ErrNotFound) {
return nil, err
} else if err == nil {
if initialClaim.MissionID == msg.MissionID {
if !initialClaim.Enabled {
return nil, types.ErrInitialClaimNotEnabled
Expand Down

0 comments on commit f8e105b

Please sign in to comment.