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
This commit is contained in:
@@ -155,8 +155,7 @@ public partial class TorrentioCrawler(
|
|||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
logger.LogError("Failed to fetch {Url}", requestUrl);
|
throw new("Failed to fetch " + requestUrl);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var json = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
|
var json = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
|
||||||
|
|||||||
Reference in New Issue
Block a user