update http exceptions

This commit is contained in:
Luke Pulverenti 2017-07-22 19:00:32 -04:00
parent b41614ac81
commit e8d1685b7e

View File

@ -736,10 +736,10 @@ namespace Emby.Common.Implementations.HttpClientManager
{
if (options.LogErrors)
{
_logger.ErrorException("Error getting response from " + options.Url, ex);
_logger.ErrorException("Error " + webException.Status + " getting response from " + options.Url, webException);
}
var exception = new HttpException(ex.Message, ex);
var exception = new HttpException(webException.Message, webException);
var response = webException.Response as HttpWebResponse;
if (response != null)
@ -752,6 +752,15 @@ namespace Emby.Common.Implementations.HttpClientManager
}
}
if (!exception.StatusCode.HasValue)
{
if (webException.Status == WebExceptionStatus.NameResolutionFailure ||
webException.Status == WebExceptionStatus.ConnectFailure)
{
exception.IsTimedOut = true;
}
}
return exception;
}