From 81c8fc0381775558be63203e988dac0bd84e8a4b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 12 Apr 2019 17:46:47 -0700 Subject: [PATCH] Fixed: Improve exception logging when unable to connect to Plex Media Server --- src/NzbDrone.Core/Notifications/Plex/PlexException.cs | 7 ++++++- .../Notifications/Plex/Server/PlexServerProxy.cs | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexException.cs b/src/NzbDrone.Core/Notifications/Plex/PlexException.cs index 2123235cd..402f4a448 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexException.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexException.cs @@ -1,4 +1,5 @@ -using NzbDrone.Common.Exceptions; +using System; +using NzbDrone.Common.Exceptions; namespace NzbDrone.Core.Notifications.Plex { @@ -11,5 +12,9 @@ namespace NzbDrone.Core.Notifications.Plex public PlexException(string message, params object[] args) : base(message, args) { } + + public PlexException(string message, Exception innerException) : base(message, innerException) + { + } } } diff --git a/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerProxy.cs index f1fd67db9..f5ec3b51a 100644 --- a/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/Server/PlexServerProxy.cs @@ -191,11 +191,11 @@ namespace NzbDrone.Core.Notifications.Plex.Server throw new PlexAuthenticationException("Unauthorized - AuthToken is invalid"); } - throw new PlexException("Unable to connect to Plex Media Server"); + throw new PlexException("Unable to connect to Plex Media Server. Status Code: {0}", ex.Response.StatusCode); } catch (WebException ex) { - throw new PlexException("Unable to connect to Plex Media Server"); + throw new PlexException("Unable to connect to Plex Media Server", ex); } return response.Content;