From 551e71cc345b312ade04451a3f2db282a5802618 Mon Sep 17 00:00:00 2001 From: Dennis Schmidt Date: Tue, 31 Jan 2023 16:09:26 +0100 Subject: [PATCH] Fixed exception handling error. --- oh22.RhinoBackup.Core/Services/DatabaseService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/oh22.RhinoBackup.Core/Services/DatabaseService.cs b/oh22.RhinoBackup.Core/Services/DatabaseService.cs index 82cbc80..36d3127 100644 --- a/oh22.RhinoBackup.Core/Services/DatabaseService.cs +++ b/oh22.RhinoBackup.Core/Services/DatabaseService.cs @@ -74,9 +74,9 @@ public async Task ExecuteAsync(IEnumerable sql, bool rollbackOnFail = tr _logger.LogDebug("Query Strings executed"); } - catch + catch (Exception ex) { - _logger.LogError("Query Strings execution failed"); + _logger.LogError(ex, "Query Strings execution failed"); if (rollbackOnFail) { @@ -91,12 +91,16 @@ public async Task ExecuteAsync(IEnumerable sql, bool rollbackOnFail = tr catch (Exception rollbackEx) { _logger.LogError(rollbackEx, "Rollback failed"); + + throw; } } else { _logger.LogDebug("Continuing"); } + + throw; } }