mirror of
https://github.com/Lidarr/Lidarr
synced 2026-03-04 03:23:36 +01:00
Better error message for DNS exceptions on mono.
This commit is contained in:
parent
1cb25525ab
commit
b02d0a33b1
1 changed files with 13 additions and 1 deletions
|
|
@ -73,7 +73,19 @@ public HttpResponse GetResponse(HttpRequest request, CookieContainer cookies)
|
|||
|
||||
if (httpWebResponse == null)
|
||||
{
|
||||
throw;
|
||||
// The default messages for WebException on mono are pretty horrible.
|
||||
if (e.Status == WebExceptionStatus.NameResolutionFailure)
|
||||
{
|
||||
throw new WebException($"DNS Name Resolution Failure: '{webRequest.RequestUri.Host}'", e.Status);
|
||||
}
|
||||
else if (OsInfo.IsNotWindows)
|
||||
{
|
||||
throw new WebException($"{e.Message}: '{webRequest.RequestUri}'", e.Status);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue