From 07c95f8112c22eb79d51d93c8b2d263d20416c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 21 Jul 2024 16:20:28 +0200 Subject: [PATCH] Propage exceptions thrown during the embedded web server initialization --- .../OpenIddictClientSystemIntegrationHttpListener.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHttpListener.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHttpListener.cs index 72804afd..25ec5949 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHttpListener.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHttpListener.cs @@ -92,15 +92,15 @@ public sealed class OpenIddictClientSystemIntegrationHttpListener : BackgroundSe } // Ignore exceptions indicating that the host is shutting down and return immediately. - catch (OperationCanceledException) when (stoppingToken.IsCancellationRequested) + catch (OperationCanceledException exception) when (stoppingToken.IsCancellationRequested) { - _source.SetResult(result: null); + _source.TrySetException(exception); return; } catch (Exception exception) when (!OpenIddictHelpers.IsFatal(exception)) { - _source.SetResult(result: null); + _source.TrySetException(exception); throw; }