[bugfix] Don't return 500 when searching for unpermitted status (#2753)

This commit is contained in:
tobi 2024-03-14 17:57:54 +01:00 committed by GitHub
parent 459e75a9db
commit 1fe4cdaf46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}