From 62decbf9944d5f1e6fa214276b68caa0887b6354 Mon Sep 17 00:00:00 2001 From: iPromKnight Date: Sun, 3 Mar 2024 19:30:06 +0000 Subject: [PATCH] Ensure we throw when torrentio/knightcrawler instances return invalid status codes on fetch requests for json payloads, pre-parsing of json, polly will catch in the policy wrapped resiliency handler --- src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs b/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs index 2e77a38..acb33bd 100644 --- a/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs +++ b/src/producer/Features/Crawlers/Torrentio/TorrentioCrawler.cs @@ -155,8 +155,7 @@ public partial class TorrentioCrawler( if (!response.IsSuccessStatusCode) { - logger.LogError("Failed to fetch {Url}", requestUrl); - return null; + throw new("Failed to fetch " + requestUrl); } var json = JsonDocument.Parse(await response.Content.ReadAsStringAsync());