From 8cdac30783ad54fad689f186d60960c60614d946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Kle=C5=A1tinec?= Date: Sun, 8 Oct 2023 09:05:26 +0200 Subject: [PATCH] Loggin exception --- src/KubernetesClient/LeaderElection/LeaderElector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KubernetesClient/LeaderElection/LeaderElector.cs b/src/KubernetesClient/LeaderElection/LeaderElector.cs index d80738ff1..d78a967ba 100644 --- a/src/KubernetesClient/LeaderElection/LeaderElector.cs +++ b/src/KubernetesClient/LeaderElection/LeaderElector.cs @@ -214,7 +214,7 @@ private async Task AcquireAsync(CancellationToken cancellationToken) else { // else timeout - _ = acq.ContinueWith(t => _ = t.Exception /* prevent UnobservedTaskException */, TaskContinuationOptions.OnlyOnFaulted); + _ = acq.ContinueWith(t => OnError?.Invoke(t.Exception), TaskContinuationOptions.OnlyOnFaulted); } } finally