Make the ErrorHandler more resilient in case an exception is thrown during the error handling

This commit is contained in:
runebaas 2020-08-31 21:50:01 +02:00
parent ce1153a0e2
commit 81373b7614
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -69,11 +69,17 @@ namespace Geekbot.Core.ErrorHandling
ReportExternal(e, errorObj); ReportExternal(e, errorObj);
} }
catch (Exception ex) catch (Exception ex)
{
try
{ {
await context.Channel.SendMessageAsync("Something went really really wrong here"); await context.Channel.SendMessageAsync("Something went really really wrong here");
}
finally
{
_logger.Error(LogSource.Geekbot, "Errorception", ex); _logger.Error(LogSource.Geekbot, "Errorception", ex);
} }
} }
}
private void ReportExternal(Exception e, MessageDto errorObj) private void ReportExternal(Exception e, MessageDto errorObj)
{ {