1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-27 00:02:25 +00:00

Fixed: Improve exception logging when unable to connect to Plex

This commit is contained in:
Qstick 2019-06-11 22:35:39 -04:00
parent 5d13ae5ae6
commit d7e465d2d7
2 changed files with 9 additions and 4 deletions

View file

@ -1,4 +1,5 @@
using NzbDrone.Common.Exceptions; using System;
using NzbDrone.Common.Exceptions;
namespace NzbDrone.Core.Notifications.Plex namespace NzbDrone.Core.Notifications.Plex
{ {
@ -11,5 +12,9 @@ public PlexException(string message) : base(message)
public PlexException(string message, params object[] args) : base(message, args) public PlexException(string message, params object[] args) : base(message, args)
{ {
} }
public PlexException(string message, Exception innerException) : base(message, innerException)
{
}
} }
} }

View file

@ -187,11 +187,11 @@ private string ProcessRequest(HttpRequestBuilder requestBuilder)
{ {
throw new PlexAuthenticationException("Unauthorized - AuthToken is invalid"); 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) 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; return response.Content;