From 991e872de95ce7ffbab7f0a0a8002a9c5a584f03 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 17 Sep 2024 10:13:01 -0400 Subject: [PATCH] chore: add requestID to error message in store validation --- waku/v2/protocol/store/pb/validation.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/waku/v2/protocol/store/pb/validation.go b/waku/v2/protocol/store/pb/validation.go index f54dea90..aea3e923 100644 --- a/waku/v2/protocol/store/pb/validation.go +++ b/waku/v2/protocol/store/pb/validation.go @@ -1,7 +1,9 @@ package pb import ( + "encoding/hex" "errors" + "fmt" ) // MaxContentTopics is the maximum number of allowed contenttopics in a query @@ -10,7 +12,6 @@ const MaxContentTopics = 10 var ( errMissingRequestID = errors.New("missing RequestId field") errMessageHashOtherFields = errors.New("cannot use MessageHashes with ContentTopics/PubsubTopic") - errRequestIDMismatch = errors.New("requestID in response does not match request") errMaxContentTopics = errors.New("exceeds the maximum number of ContentTopics allowed") errEmptyContentTopic = errors.New("one or more content topics specified is empty") errMissingPubsubTopic = errors.New("missing PubsubTopic field") @@ -58,7 +59,7 @@ func (x *StoreQueryRequest) Validate() error { func (x *StoreQueryResponse) Validate(requestID string) error { if x.RequestId != "" && x.RequestId != requestID { - return errRequestIDMismatch + return fmt.Errorf("requestID %s in response does not match requestID in request %s", hex.EncodeToString([]byte(x.RequestId)), hex.EncodeToString([]byte(requestID))) } if x.StatusCode == nil {