diff options
author | 2023-04-06 13:19:55 +0200 | |
---|---|---|
committer | 2023-04-06 12:19:55 +0100 | |
commit | c54510bc7407f22b58bd56ad65b2e3f60e8e4dc5 (patch) | |
tree | 26b1650686a8be480cd3115e3c2d814aa50e91c0 /internal/processing/search.go | |
parent | [bugfix] Always serialize orderedItems as array (#1673) (diff) | |
download | gotosocial-c54510bc7407f22b58bd56ad65b2e3f60e8e4dc5.tar.xz |
[bugfix] Normalize status content (don't parse status content as IRI) (#1665)
* start fannying about
* finish up Normalize
* tidy up
* pin to tag
* move errors about just a little bit
Diffstat (limited to 'internal/processing/search.go')
-rw-r--r-- | internal/processing/search.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/processing/search.go b/internal/processing/search.go index 9aa89a17b..0c9ef43fd 100644 --- a/internal/processing/search.go +++ b/internal/processing/search.go @@ -25,6 +25,7 @@ import ( "strings" "codeberg.org/gruf/go-kv" + "github.com/superseriousbusiness/gotosocial/internal/ap" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -131,9 +132,10 @@ func (p *Processor) SearchGet(ctx context.Context, authed *oauth.Auth, search *a // check if it's a status... foundStatus, err := p.searchStatusByURI(ctx, authed, uri) if err != nil { + // Check for semi-expected error types. var ( errNotRetrievable *dereferencing.ErrNotRetrievable - errWrongType *dereferencing.ErrWrongType + errWrongType *ap.ErrWrongType ) if !errors.As(err, &errNotRetrievable) && !errors.As(err, &errWrongType) { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error looking up status: %w", err)) @@ -148,9 +150,10 @@ func (p *Processor) SearchGet(ctx context.Context, authed *oauth.Auth, search *a if !foundOne { foundAccount, err := p.searchAccountByURI(ctx, authed, uri, search.Resolve) if err != nil { + // Check for semi-expected error types. var ( errNotRetrievable *dereferencing.ErrNotRetrievable - errWrongType *dereferencing.ErrWrongType + errWrongType *ap.ErrWrongType ) if !errors.As(err, &errNotRetrievable) && !errors.As(err, &errWrongType) { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error looking up account: %w", err)) |