From 56256fb2aedc48efdfce7e2e806a6e280de47c48 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 14 Nov 2023 11:15:35 +0100 Subject: [PATCH] chore: improve error message seen by RPC consumers when the given supplier isn't on-chain --- x/supplier/keeper/query_supplier.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index 14d5afab5..d1beeb821 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -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