Log invalid config file exceptions

(cherry picked from commit e1d0e2c79975a10c12fc8551f5dcd4a79f1c94e7)
pull/5623/head
Bogdan 1 year ago committed by Mark McDowall
parent 3a6c078b30
commit a95317446c

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
@ -8,15 +7,12 @@ using System.Security.Cryptography.X509Certificates;
using System.Text;
using DryIoc;
using DryIoc.Microsoft.DependencyInjection;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.WindowsServices;
using NLog;
using NzbDrone.Common.Composition.Extensions;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Exceptions;
using NzbDrone.Common.Extensions;
@ -24,7 +20,6 @@ using NzbDrone.Common.Instrumentation;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Datastore.Extensions;
using NzbDrone.Host;
namespace NzbDrone.Host
{
@ -209,6 +204,8 @@ namespace NzbDrone.Host
}
catch (InvalidDataException ex)
{
Logger.Error(ex, ex.Message);
throw new InvalidConfigFileException($"{configPath} is corrupt or invalid. Please delete the config file and Sonarr will recreate it.", ex);
}
}

Loading…
Cancel
Save