summaryrefslogtreecommitdiff
path: root/internal/processing/search/get.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-03-14 17:57:54 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-14 17:57:54 +0100
commit1fe4cdaf46c4fc1e600ce1dff0646ac53e3d265a (patch)
tree703de82dcac45dfd8439d8e4d03f4530a02ea34a /internal/processing/search/get.go
parent[bugfix] only check replyTo visibility during permission checks IF status is ... (diff)
downloadgotosocial-1fe4cdaf46c4fc1e600ce1dff0646ac53e3d265a.tar.xz
[bugfix] Don't return 500 when searching for unpermitted status (#2753)
Diffstat (limited to 'internal/processing/search/get.go')
-rw-r--r--internal/processing/search/get.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/internal/processing/search/get.go b/internal/processing/search/get.go
index c0b011bdb..e4839a179 100644
--- a/internal/processing/search/get.go
+++ b/internal/processing/search/get.go
@@ -491,7 +491,14 @@ func (p *Processor) byURI(
if err != nil {
// Check for semi-expected error types.
// On one of these, we can continue.
- if !gtserror.IsUnretrievable(err) && !gtserror.IsWrongType(err) {
+ switch {
+ case gtserror.IsUnretrievable(err),
+ gtserror.IsWrongType(err):
+ log.Debugf(ctx,
+ "semi-expected error type looking up %s as account: %v",
+ uri, err,
+ )
+ default:
err = gtserror.Newf("error looking up %s as account: %w", uri, err)
return gtserror.NewErrorInternalError(err)
}
@@ -509,7 +516,15 @@ func (p *Processor) byURI(
if err != nil {
// Check for semi-expected error types.
// On one of these, we can continue.
- if !gtserror.IsUnretrievable(err) && !gtserror.IsWrongType(err) {
+ switch {
+ case gtserror.IsUnretrievable(err),
+ gtserror.IsWrongType(err),
+ gtserror.NotPermitted(err):
+ log.Debugf(ctx,
+ "semi-expected error type looking up %s as status: %v",
+ uri, err,
+ )
+ default:
err = gtserror.Newf("error looking up %s as status: %w", uri, err)
return gtserror.NewErrorInternalError(err)
}