From 81373b76144f9acf231c76e75c564d19a86d12c1 Mon Sep 17 00:00:00 2001 From: runebaas Date: Mon, 31 Aug 2020 21:50:01 +0200 Subject: [PATCH] Make the ErrorHandler more resilient in case an exception is thrown during the error handling --- src/Core/ErrorHandling/ErrorHandler.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Core/ErrorHandling/ErrorHandler.cs b/src/Core/ErrorHandling/ErrorHandler.cs index 47ed22d..60d97e9 100644 --- a/src/Core/ErrorHandling/ErrorHandler.cs +++ b/src/Core/ErrorHandling/ErrorHandler.cs @@ -70,8 +70,14 @@ namespace Geekbot.Core.ErrorHandling } catch (Exception ex) { - await context.Channel.SendMessageAsync("Something went really really wrong here"); - _logger.Error(LogSource.Geekbot, "Errorception", ex); + try + { + await context.Channel.SendMessageAsync("Something went really really wrong here"); + } + finally + { + _logger.Error(LogSource.Geekbot, "Errorception", ex); + } } }