From 6c11d1164568a6f08bb1a377dd2288d468b690db Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 15 Jun 2022 13:18:00 +0200 Subject: [PATCH] Rss errors will now show error counter until deletion --- src/NadekoBot/Modules/Searches/Feeds/FeedsService.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Feeds/FeedsService.cs b/src/NadekoBot/Modules/Searches/Feeds/FeedsService.cs index 991c6af29..38f51eb5a 100644 --- a/src/NadekoBot/Modules/Searches/Feeds/FeedsService.cs +++ b/src/NadekoBot/Modules/Searches/Feeds/FeedsService.cs @@ -49,7 +49,7 @@ public class FeedsService : INService private void ClearErrors(string url) => _errorCounters.Remove(url); - private async Task AddError(string url, List ids) + private async Task AddError(string url, List ids) { try { @@ -68,10 +68,13 @@ public class FeedsService : INService // reset the error counter ClearErrors(url); } + + return newValue; } catch (Exception ex) { Log.Error(ex, "Error adding rss errors..."); + return 0; } } @@ -181,12 +184,13 @@ public class FeedsService : INService } catch (Exception ex) { - Log.Warning("An error occured while getting rss stream {RssFeed}" + var errorCount = await AddError(rssUrl, kvp.Value.Select(x => x.Id).ToList()); + + Log.Warning("An error occured while getting rss stream ({ErrorCount} / 100) {RssFeed}" + "\n {Message}", + errorCount, rssUrl, $"[{ex.GetType().Name}]: {ex.Message}"); - - await AddError(rssUrl, kvp.Value.Select(x => x.Id).ToList()); } }