|
|
|
@ -30,8 +30,7 @@ namespace NzbDrone.Common
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (RestProvider == null && EnviromentProvider.IsProduction)
|
|
|
|
|
return;
|
|
|
|
|
VerifyRestProvider();
|
|
|
|
|
|
|
|
|
|
lock (parserErrorCache)
|
|
|
|
|
{
|
|
|
|
@ -59,9 +58,8 @@ namespace NzbDrone.Common
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (RestProvider == null && EnviromentProvider.IsProduction)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
VerifyRestProvider();
|
|
|
|
|
|
|
|
|
|
var report = new ExceptionReport();
|
|
|
|
|
report.LogMessage = logEvent.FormattedMessage;
|
|
|
|
|
report.String = logEvent.Exception.ToString();
|
|
|
|
@ -81,5 +79,21 @@ namespace NzbDrone.Common
|
|
|
|
|
logger.Info("Unable to report exception. " + e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void VerifyRestProvider()
|
|
|
|
|
{
|
|
|
|
|
if(RestProvider == null)
|
|
|
|
|
{
|
|
|
|
|
if(EnviromentProvider.IsProduction)
|
|
|
|
|
{
|
|
|
|
|
logger.Warn("Rest provider wasn't provided. creating new one!");
|
|
|
|
|
RestProvider = new RestProvider(new EnviromentProvider());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException("REST Provider wasn't configured correctly.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|