1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-31 20:26:16 +00:00

Better error message for DNS exceptions on mono.

This commit is contained in:
Taloth Saldono 2017-07-29 12:34:34 +02:00
parent 1cb25525ab
commit b02d0a33b1

View file

@ -73,7 +73,19 @@ namespace NzbDrone.Common.Http.Dispatchers
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;
}
}
}