1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-27 00:02:25 +00:00

Fixed: Better error message for DNS exceptions on mono.

This commit is contained in:
Qstick 2017-10-28 23:58:16 -04:00
parent f09ef025c5
commit 272adfcef7

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Net; using System.Net;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
@ -73,7 +73,19 @@ public HttpResponse GetResponse(HttpRequest request, CookieContainer cookies)
if (httpWebResponse == null) 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;
};
} }
} }