1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -04:00

Log Skyhook connection failures with more info.

This commit is contained in:
Taloth Saldono
2021-03-10 21:43:43 +01:00
parent e4a064a1c0
commit 6672650b6b
3 changed files with 24 additions and 6 deletions
@@ -13,5 +13,10 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
: base(HttpStatusCode.ServiceUnavailable, message, args)
{
}
public SkyHookException(string message, Exception innerException, params object[] args)
: base(HttpStatusCode.ServiceUnavailable, innerException, message, args)
{
}
}
}
@@ -109,14 +109,20 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
return httpResponse.Resource.SelectList(MapSearchResult);
}
catch (HttpException)
catch (HttpException ex)
{
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with SkyHook.", title);
_logger.Warn(ex);
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with SkyHook.", 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)
{
_logger.Warn(ex, ex.Message);
throw new SkyHookException("Search for '{0}' failed. Invalid response received from SkyHook.", title);
_logger.Warn(ex);
throw new SkyHookException("Search for '{0}' failed. Invalid response received from SkyHook.", ex, title);
}
}