Fixed: Better error message for DNS exceptions on mono.

pull/6/head
Qstick 7 years ago
parent f09ef025c5
commit 272adfcef7

@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
@ -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;
};
}
}

Loading…
Cancel
Save