From d8d5818b47009f28433a7e96bcce8d116c8a9769 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:38:43 +0000 Subject: [bugfix] internal server error on search not found (#1590) * add error value wrapping, include status code / not found flags from transport errors, update error usages Signed-off-by: kim * add code commenting for gtserror functions Signed-off-by: kim --------- Signed-off-by: kim --- internal/federation/federatingprotocol.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/federation/federatingprotocol.go') diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go index e60f278c7..49b38eda4 100644 --- a/internal/federation/federatingprotocol.go +++ b/internal/federation/federatingprotocol.go @@ -31,6 +31,7 @@ import ( "github.com/superseriousbusiness/activity/streams/vocab" "github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/db" + "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/log" "github.com/superseriousbusiness/gotosocial/internal/transport" @@ -210,7 +211,7 @@ func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr transport.WithFastfail(ctx), username, publicKeyOwnerURI, false, ) if err != nil { - if errors.Is(err, transport.ErrGone) { + if gtserror.StatusCode(err) == http.StatusGone { // This is the same case as the http.StatusGone check above. // It can happen here and not there because there's a race // where the sending server starts sending account deletion -- cgit v1.2.3