summaryrefslogtreecommitdiff
path: root/internal/processing/common/status.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-08 14:32:17 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-08 14:32:17 +0000
commite9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch)
tree52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/processing/common/status.go
parent[chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff)
downloadgotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/processing/common/status.go')
-rw-r--r--internal/processing/common/status.go14
1 files changed, 10 insertions, 4 deletions
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