From a95317446c452926819ad24f892a00770b1b23fc Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 7 May 2023 16:51:00 +0300 Subject: [PATCH] Log invalid config file exceptions (cherry picked from commit e1d0e2c79975a10c12fc8551f5dcd4a79f1c94e7) --- src/NzbDrone.Host/Bootstrap.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Host/Bootstrap.cs b/src/NzbDrone.Host/Bootstrap.cs index c9ede9d05..d9d62d3c1 100644 --- a/src/NzbDrone.Host/Bootstrap.cs +++ b/src/NzbDrone.Host/Bootstrap.cs @@ -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); } }