From 2d41ebcc7802b74068bccda8a6793cf612325fc1 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 4 Jul 2013 22:16:49 -0700 Subject: [PATCH] made some of useless exceptions to calm down. --- NzbDrone.Common/StringExtensions.cs | 5 ----- NzbDrone.Core/Indexers/IndexerFetchService.cs | 6 ++---- NzbDrone.Core/MediaCover/MediaCoverService.cs | 5 +++++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/NzbDrone.Common/StringExtensions.cs b/NzbDrone.Common/StringExtensions.cs index 9cfa71e4b..6fcbea57b 100644 --- a/NzbDrone.Common/StringExtensions.cs +++ b/NzbDrone.Common/StringExtensions.cs @@ -10,11 +10,6 @@ public static string Inject(this string format, params object[] formattingArgs) return string.Format(format, formattingArgs); } - public static string Inject(this string format, params string[] formattingArgs) - { - return string.Format(format, formattingArgs.Cast()); - } - private static readonly Regex InvalidCharRegex = new Regex(@"[^a-z0-9\s-]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex InvalidSearchCharRegex = new Regex(@"[^a-z0-9\s-\.]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CollapseSpace = new Regex(@"\s+", RegexOptions.Compiled | RegexOptions.IgnoreCase); diff --git a/NzbDrone.Core/Indexers/IndexerFetchService.cs b/NzbDrone.Core/Indexers/IndexerFetchService.cs index 116ef4a58..29a634661 100644 --- a/NzbDrone.Core/Indexers/IndexerFetchService.cs +++ b/NzbDrone.Core/Indexers/IndexerFetchService.cs @@ -4,8 +4,6 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.IndexerSearch.Definitions; -using NzbDrone.Core.Model; -using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.Indexers @@ -106,14 +104,14 @@ private List Fetch(IIndexer indexer, IEnumerable urls) } catch (WebException webException) { - if (webException.Message.Contains("503")) + if (webException.Message.Contains("503") || webException.Message.Contains("timed out")) { _logger.Warn("{0} server is currently unavailable.{1} {2}", indexer.Name, url, webException.Message); } else { webException.Data.Add("FeedUrl", url); - _logger.ErrorException("An error occurred while processing feed. " + url, webException); + _logger.WarnException("An error occurred while processing feed. " + url, webException); } } catch (Exception feedEx) diff --git a/NzbDrone.Core/MediaCover/MediaCoverService.cs b/NzbDrone.Core/MediaCover/MediaCoverService.cs index 9edbec187..b455a7e8c 100644 --- a/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Net; using NLog; using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; @@ -59,6 +60,10 @@ private void DownloadCover(Series series, MediaCover cover) _logger.Info("Downloading {0} for {1} {2}", cover.CoverType, series.Title, cover.Url); _httpProvider.DownloadFile(cover.Url, fileName); } + catch (WebException e) + { + _logger.WarnException("Couldn't download media cover for " + series.TvdbId, e); + } catch (Exception e) { _logger.ErrorException("Couldn't download media cover for " + series.TvdbId, e);