parent
39250abf7d
commit
4abf44617c
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using NzbDrone.Common.Exceptions;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Gotify
|
||||
{
|
||||
public class GotifyException : NzbDroneException
|
||||
{
|
||||
public GotifyException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public GotifyException(string message, Exception innerException, params object[] args)
|
||||
: base(message, innerException, args)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.Gotify
|
||||
{
|
||||
public class InvalidResponseException : Exception
|
||||
{
|
||||
public InvalidResponseException()
|
||||
{
|
||||
}
|
||||
|
||||
public InvalidResponseException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Http.Proxy;
|
||||
using RestSharp;
|
||||
|
||||
namespace NzbDrone.Core.Rest
|
||||
{
|
||||
public class RestClientFactory : IRestClientFactory
|
||||
{
|
||||
private readonly IHttpProxySettingsProvider _httpProxySettingsProvider;
|
||||
private readonly ICreateManagedWebProxy _createManagedWebProxy;
|
||||
|
||||
public RestClientFactory(IHttpProxySettingsProvider httpProxySettingsProvider, ICreateManagedWebProxy createManagedWebProxy)
|
||||
{
|
||||
_httpProxySettingsProvider = httpProxySettingsProvider;
|
||||
_createManagedWebProxy = createManagedWebProxy;
|
||||
}
|
||||
|
||||
public RestClient BuildClient(string baseUrl)
|
||||
{
|
||||
var restClient = new RestClient(baseUrl)
|
||||
{
|
||||
UserAgent = $"{BuildInfo.AppName}/{BuildInfo.Version} ({OsInfo.Os})"
|
||||
};
|
||||
|
||||
var proxySettings = _httpProxySettingsProvider.GetProxySettings();
|
||||
if (proxySettings != null)
|
||||
{
|
||||
restClient.Proxy = _createManagedWebProxy.GetWebProxy(proxySettings);
|
||||
}
|
||||
|
||||
return restClient;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue