From b57c0b467d7f223980bc0df58c031790a4c41fd3 Mon Sep 17 00:00:00 2001 From: Mike Mason Date: Fri, 15 Mar 2024 09:43:08 -0500 Subject: [PATCH] correctly return message error if exists (#224) previously we were checking if the message had an error (which happens when the message fails to be decoded as json) and then we were promptly returning the nil error previously returned from the method request. Now we capture the error returned by the `resp.Error()` method and return the error if one exists. Signed-off-by: Mike Mason --- pkg/permissions/relationships.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/permissions/relationships.go b/pkg/permissions/relationships.go index eee5592d..be9369e8 100644 --- a/pkg/permissions/relationships.go +++ b/pkg/permissions/relationships.go @@ -77,7 +77,7 @@ func (p *Permissions) submitAuthRelationshipRequest(ctx context.Context, topic s } if resp != nil { - if resp.Error() != nil { + if err := resp.Error(); err != nil { errs = append(errs, err) }