diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-07-22 19:00:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-07-22 19:00:32 -0400 |
| commit | e8d1685b7e4a42d5afb5a7e3bfe1a30c350d9da1 (patch) | |
| tree | 07d56413a432b7c13e389bc61a4a370679e9e64e | |
| parent | b41614ac81e113364080a2fe96e92723d50f4b06 (diff) | |
update http exceptions
| -rw-r--r-- | Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs index 5bd18cb80..700d04c4d 100644 --- a/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -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; } |
