mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-23 14:30:49 +00:00
Log Skyhook connection failures with more info
Closes #2078 Closes #2079 Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
This commit is contained in:
parent
79a175c74d
commit
f9062a3213
3 changed files with 24 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.Net;
|
using System;
|
||||||
|
using System.Net;
|
||||||
using NzbDrone.Common.Exceptions;
|
using NzbDrone.Common.Exceptions;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Exceptions
|
namespace NzbDrone.Core.Exceptions
|
||||||
|
@ -13,6 +14,12 @@ public NzbDroneClientException(HttpStatusCode statusCode, string message, params
|
||||||
StatusCode = statusCode;
|
StatusCode = statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NzbDroneClientException(HttpStatusCode statusCode, string message, Exception innerException, params object[] args)
|
||||||
|
: base(message, innerException, args)
|
||||||
|
{
|
||||||
|
StatusCode = statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
public NzbDroneClientException(HttpStatusCode statusCode, string message)
|
public NzbDroneClientException(HttpStatusCode statusCode, string message)
|
||||||
: base(message)
|
: base(message)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Net;
|
using System;
|
||||||
|
using System.Net;
|
||||||
using NzbDrone.Core.Exceptions;
|
using NzbDrone.Core.Exceptions;
|
||||||
|
|
||||||
namespace NzbDrone.Core.MetadataSource.SkyHook
|
namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||||
|
@ -14,5 +15,10 @@ public SkyHookException(string message, params object[] args)
|
||||||
: base(HttpStatusCode.ServiceUnavailable, message, args)
|
: base(HttpStatusCode.ServiceUnavailable, message, args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SkyHookException(string message, Exception innerException, params object[] args)
|
||||||
|
: base(HttpStatusCode.ServiceUnavailable, message, innerException, args)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,14 +227,20 @@ public List<Artist> SearchForNewArtist(string title)
|
||||||
|
|
||||||
return httpResponse.Resource.SelectList(MapSearchResult);
|
return httpResponse.Resource.SelectList(MapSearchResult);
|
||||||
}
|
}
|
||||||
catch (HttpException)
|
catch (HttpException ex)
|
||||||
{
|
{
|
||||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with LidarrAPI.", title);
|
_logger.Warn(ex);
|
||||||
|
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with LidarrAPI.", ex, title);
|
||||||
|
}
|
||||||
|
catch (WebException ex)
|
||||||
|
{
|
||||||
|
_logger.Warn(ex);
|
||||||
|
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with SkyHook.", ex, title, ex.Message);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Warn(ex, ex.Message);
|
_logger.Warn(ex, ex.Message);
|
||||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from LidarrAPI.", title);
|
throw new SkyHookException("Search for '{0}' failed. Invalid response received from LidarrAPI.", ex, title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue