From e8b7df996a6c3f8937adbe0d55d75acb38090979 Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Sun, 11 Feb 2018 17:28:43 -0600 Subject: [PATCH] catch aggregateexception likely non-txt files like zips --- src/FilterLists.Services/SnapshotService/SnapshotDe.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/FilterLists.Services/SnapshotService/SnapshotDe.cs b/src/FilterLists.Services/SnapshotService/SnapshotDe.cs index a23943d9e..4e776255f 100644 --- a/src/FilterLists.Services/SnapshotService/SnapshotDe.cs +++ b/src/FilterLists.Services/SnapshotService/SnapshotDe.cs @@ -14,7 +14,10 @@ namespace FilterLists.Services.SnapshotService public class SnapshotDe { private const int BatchSize = 1000; - private const string UserAgentString = @"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"; + + private const string UserAgentString = + @"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"; + private readonly FilterListsDbContext dbContext; private readonly FilterListViewUrlDto list; private Snapshot snapshot; @@ -67,6 +70,11 @@ private async Task TryGetContent() snapshot.HttpStatusCode = null; return null; } + catch (AggregateException) + { + snapshot.HttpStatusCode = null; + return null; + } } private async Task GetContent()