From 7bea641b0ea52eda1344a258ecffffd165dbbd71 Mon Sep 17 00:00:00 2001 From: Maciej Zieniuk Date: Sat, 9 Nov 2024 14:28:31 +0000 Subject: [PATCH] PM-10600: Throw Xunit assert exception when sending request via BaseIdentityClientService SendAsync in BaseIdentityClientService never throws exception. Ideally this behaviour should be changed, and the method should throw error on any failure, but it's not in scope of change. Will be fixed by PM-14675 --- .../Services/Implementations/BaseIdentityClientService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Core/Services/Implementations/BaseIdentityClientService.cs b/src/Core/Services/Implementations/BaseIdentityClientService.cs index f6d623692..f3754a344 100644 --- a/src/Core/Services/Implementations/BaseIdentityClientService.cs +++ b/src/Core/Services/Implementations/BaseIdentityClientService.cs @@ -90,6 +90,12 @@ public abstract class BaseIdentityClientService : IDisposable catch (Exception e) { _logger.LogError(12334, e, "Failed to send to {0}.", message.RequestUri.ToString()); + // Throw for testing purposes + // TODO Fixed by https://bitwarden.atlassian.net/browse/PM-14675 + if (e.GetType().Namespace?.StartsWith("Xunit") ?? false) + { + throw; + } return default; } }