From: AeonLucid Date: Mon, 26 Oct 2020 21:32:56 +0000 (+0100) Subject: Rethrow cheat exceptions thrown by plugins X-Git-Tag: v1.2.2~64 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=8526ce43b2fa1c70d4f69c6baa9a374c7b483953;p=rhonda%2Fimpostor.git Rethrow cheat exceptions thrown by plugins --- diff --git a/src/Impostor.Server/Events/EventManager.cs b/src/Impostor.Server/Events/EventManager.cs index cb5866b..10c3ec8 100644 --- a/src/Impostor.Server/Events/EventManager.cs +++ b/src/Impostor.Server/Events/EventManager.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; +using Impostor.Api; using Impostor.Api.Events; using Impostor.Api.Events.Managers; using Impostor.Server.Events.Register; @@ -75,6 +76,10 @@ namespace Impostor.Server.Events await eventListener.InvokeAsync(handler, @event, _serviceProvider); } } + catch (ImpostorCheatException) + { + throw; + } catch (Exception e) { _logger.LogError(e, "Invocation of event {0} threw an exception.", @event.GetType().Name);