diff --git a/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs b/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs index 3949877b1..a7a14e948 100644 --- a/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs +++ b/src/Platform/StellaOps.Platform.WebService/Endpoints/RegistrySearchEndpoints.cs @@ -109,6 +109,17 @@ public static class RegistrySearchEndpoints RegistryId = "harbor-fixture" }); } + catch (JsonException jex) + { + logger.LogWarning(jex, "Harbor returned non-JSON response for query '{Query}'", query); + + return Results.Ok(new RegistrySearchResponse + { + Items = [], + TotalCount = 0, + RegistryId = "harbor-fixture" + }); + } catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException or OperationCanceledException) { logger.LogWarning(ex, "Harbor registry unreachable during image search for query '{Query}'", query);