From a738cfb23a8833a578766f86905ad644f6d47537 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 14 May 2022 10:05:42 -0500 Subject: [PATCH] Catch Postgres log connection errors --- src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs index ecd41cceb..971d939d4 100644 --- a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs +++ b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs @@ -97,6 +97,11 @@ namespace NzbDrone.Core.Instrumentation WritePostgresLog(log, connectionString); } } + catch (NpgsqlException ex) + { + InternalLogger.Error("Unable to save log event to database: {0}", ex); + throw; + } catch (SQLiteException ex) { InternalLogger.Error("Unable to save log event to database: {0}", ex);