From e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:32:17 +0000 Subject: [feature] add support for polls + receiving federated status edits (#2330) --- internal/processing/common/account.go.go | 14 ++++++++++---- internal/processing/common/status.go | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'internal/processing/common') diff --git a/internal/processing/common/account.go.go b/internal/processing/common/account.go.go index 06e87fa0e..425f23483 100644 --- a/internal/processing/common/account.go.go +++ b/internal/processing/common/account.go.go @@ -47,8 +47,11 @@ func (p *Processor) GetTargetAccountBy( if target == nil { // DB loader could not find account in database. - err := errors.New("target account not found") - return nil, false, gtserror.NewErrorNotFound(err) + const text = "target account not found" + return nil, false, gtserror.NewErrorNotFound( + errors.New(text), + text, + ) } // Check whether target account is visible to requesting account. @@ -106,8 +109,11 @@ func (p *Processor) GetVisibleTargetAccount( if !visible { // Pretend account doesn't exist if not visible. - err := errors.New("target account not found") - return nil, gtserror.NewErrorNotFound(err) + const text = "target account not found" + return nil, gtserror.NewErrorNotFound( + errors.New(text), + text, + ) } return target, nil diff --git a/internal/processing/common/status.go b/internal/processing/common/status.go index fb480ec7e..233c1c867 100644 --- a/internal/processing/common/status.go +++ b/internal/processing/common/status.go @@ -47,8 +47,11 @@ func (p *Processor) GetTargetStatusBy( if target == nil { // DB loader could not find status in database. - err := errors.New("target status not found") - return nil, false, gtserror.NewErrorNotFound(err) + const text = "target status not found" + return nil, false, gtserror.NewErrorNotFound( + errors.New(text), + text, + ) } // Check whether target status is visible to requesting account. @@ -106,8 +109,11 @@ func (p *Processor) GetVisibleTargetStatus( if !visible { // Target should not be seen by requester. - err := errors.New("target status not found") - return nil, gtserror.NewErrorNotFound(err) + const text = "target status not found" + return nil, gtserror.NewErrorNotFound( + errors.New(text), + text, + ) } return target, nil -- cgit v1.2.3