From 8b3e25e7db0d72b1d95b56d9874dfac378f7287a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 15 Nov 2024 18:43:29 +0100 Subject: [PATCH] [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". --- Iceshrimp.Backend/Controllers/Web/SearchController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Iceshrimp.Backend/Controllers/Web/SearchController.cs b/Iceshrimp.Backend/Controllers/Web/SearchController.cs index a318d06d..f63b43c6 100644 --- a/Iceshrimp.Backend/Controllers/Web/SearchController.cs +++ b/Iceshrimp.Backend/Controllers/Web/SearchController.cs @@ -88,9 +88,8 @@ public class SearchController( if (target.StartsWith('@') || target.StartsWith(userPrefixAlt)) { - var hit = await userResolver.ResolveOrNullAsync(target, SearchFlags); - if (hit != null) return new RedirectResponse { TargetUrl = $"/users/{hit.Id}" }; - throw GracefulException.NotFound("No result found"); + var hit = await userResolver.ResolveAsync(target, SearchFlags); + return new RedirectResponse { TargetUrl = $"/users/{hit.Id}" }; } if (target.StartsWith("https://"))