[backend/api] Report errors during acct user lookups to the client
This causes user lookups for blocked users to return a more specific error message than "No result found".
This commit is contained in:
parent
28b3b56646
commit
8b3e25e7db
1 changed files with 2 additions and 3 deletions
|
@ -88,9 +88,8 @@ public class SearchController(
|
||||||
|
|
||||||
if (target.StartsWith('@') || target.StartsWith(userPrefixAlt))
|
if (target.StartsWith('@') || target.StartsWith(userPrefixAlt))
|
||||||
{
|
{
|
||||||
var hit = await userResolver.ResolveOrNullAsync(target, SearchFlags);
|
var hit = await userResolver.ResolveAsync(target, SearchFlags);
|
||||||
if (hit != null) return new RedirectResponse { TargetUrl = $"/users/{hit.Id}" };
|
return new RedirectResponse { TargetUrl = $"/users/{hit.Id}" };
|
||||||
throw GracefulException.NotFound("No result found");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.StartsWith("https://"))
|
if (target.StartsWith("https://"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue