diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs index 726cac410..d9c1102b4 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using Newtonsoft.Json.Linq; +using NLog; using NzbDrone.Common; using NzbDrone.Common.Cache; using NzbDrone.Common.Serializer; @@ -19,10 +20,12 @@ namespace NzbDrone.Core.Notifications.Plex public class PlexServerProxy : IPlexServerProxy { private readonly ICached _authCache; + private readonly Logger _logger; - public PlexServerProxy(ICacheManager cacheManager) + public PlexServerProxy(ICacheManager cacheManager, Logger logger) { _authCache = cacheManager.GetCache(GetType(), "authCache"); + _logger = logger; } public List GetTvSections(PlexServerSettings settings) @@ -32,6 +35,9 @@ namespace NzbDrone.Core.Notifications.Plex var response = client.Execute(request); + CheckForError(response.Content); + _logger.Trace("Sections response: {0}", response.Content); + return Json.Deserialize(response.Content) .Directories .Where(d => d.Type == "show") @@ -45,6 +51,9 @@ namespace NzbDrone.Core.Notifications.Plex var client = GetPlexServerClient(settings); var response = client.Execute(request); + + CheckForError(response.Content); + _logger.Trace("Update response: {0}", response.Content); } private String Authenticate(string username, string password) @@ -53,6 +62,7 @@ namespace NzbDrone.Core.Notifications.Plex var client = GetMyPlexClient(username, password); var response = client.Execute(request); + CheckForError(response.Content); var user = Json.Deserialize(JObject.Parse(response.Content).SelectToken("user").ToString());