From 14460d6c097de7c2ebd939b4ceadebc9c99ead04 Mon Sep 17 00:00:00 2001 From: Erisa A Date: Fri, 1 Nov 2024 20:10:20 +0000 Subject: [PATCH] DiscordSink: wait for exceptions to propagate Fixes #237 --- Helpers/DiscordSink.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Helpers/DiscordSink.cs b/Helpers/DiscordSink.cs index a7a3042e..35d0a6e0 100644 --- a/Helpers/DiscordSink.cs +++ b/Helpers/DiscordSink.cs @@ -19,6 +19,11 @@ public DiscordSink(ITextFormatter textFormatter) public async void Emit(LogEvent logEvent) { + // wait for exceptions to propagate + // TODO(erisa): find a better way to do this + if (logEvent.Exception is not null ) + await Task.Delay(100); + if (logEvent is null) throw new ArgumentNullException(nameof(logEvent)); lock (_syncRoot) {