From 36387dd13f682d35f1c3779ebb12f3b8f52414ba Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 20 Feb 2014 18:30:30 -0800 Subject: [PATCH] Fixed: Prevent queue errors from filling up UI with errors --- src/NzbDrone.Core/Queue/QueueService.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Queue/QueueService.cs b/src/NzbDrone.Core/Queue/QueueService.cs index ce81a1bfd..963a2a747 100644 --- a/src/NzbDrone.Core/Queue/QueueService.cs +++ b/src/NzbDrone.Core/Queue/QueueService.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using NLog; using NzbDrone.Core.Download; @@ -30,9 +31,17 @@ namespace NzbDrone.Core.Queue return new List(); } - var queueItems = downloadClient.GetQueue(); + try + { + var queueItems = downloadClient.GetQueue(); - return MapQueue(queueItems); + return MapQueue(queueItems); + } + catch (Exception ex) + { + _logger.Error("Error getting queue from download client: " + downloadClient.ToString(), ex); + return new List(); + } } private List MapQueue(IEnumerable queueItems)