Skip to content

Commit

Permalink
chore: improve error message seen by RPC consumers when the given sup…
Browse files Browse the repository at this point in the history
…plier isn't on-chain
  • Loading branch information
bryanchriswhite committed Nov 14, 2023
1 parent a61013d commit 56256fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/supplier/keeper/query_supplier.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"context"
"fmt"

"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -52,7 +53,8 @@ func (k Keeper) Supplier(goCtx context.Context, req *types.QueryGetSupplierReque
req.Address,
)
if !found {
return nil, status.Error(codes.NotFound, "not found")
msg := fmt.Sprintf("supplier with address %q", req.GetAddress())
return nil, status.Error(codes.NotFound, msg)
}

return &types.QueryGetSupplierResponse{Supplier: val}, nil
Expand Down

0 comments on commit 56256fb

Please sign in to comment.