diff options
author | 2023-03-06 09:38:43 +0000 | |
---|---|---|
committer | 2023-03-06 10:38:43 +0100 | |
commit | d8d5818b47009f28433a7e96bcce8d116c8a9769 (patch) | |
tree | a93b7fe7deaa286fde5eab450b4cb30fbe7566dd /internal/federation/federatingprotocol.go | |
parent | [feature] Add support for profile fields (#1483) (diff) | |
download | gotosocial-d8d5818b47009f28433a7e96bcce8d116c8a9769.tar.xz |
[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 <grufwub@gmail.com>
* add code commenting for gtserror functions
Signed-off-by: kim <grufwub@gmail.com>
---------
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r-- | internal/federation/federatingprotocol.go | 3 |
1 files changed, 2 insertions, 1 deletions
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 |