mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed: Better error message for DNS exceptions on mono.
This commit is contained in:
parent
f09ef025c5
commit
272adfcef7
1 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||||
|
@ -72,8 +72,20 @@ namespace NzbDrone.Common.Http.Dispatchers
|
||||||
httpWebResponse = (HttpWebResponse)e.Response;
|
httpWebResponse = (HttpWebResponse)e.Response;
|
||||||
|
|
||||||
if (httpWebResponse == null)
|
if (httpWebResponse == null)
|
||||||
|
{
|
||||||
|
// 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;
|
throw;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue