<PackageReference Include="System.Reactive" Version="6.0.0-preview.9" />

ExceptionHelpers

static class ExceptionHelpers
using System.Diagnostics.CodeAnalysis; using System.Reactive.PlatformServices; using System.Runtime.CompilerServices; namespace System.Reactive { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] internal static class ExceptionHelpers { private static readonly Lazy<IExceptionServices> Services = new Lazy<IExceptionServices>(Initialize); [System.Diagnostics.CodeAnalysis.DoesNotReturn] public static void Throw(this Exception exception) { Services.Value.Rethrow(exception); } private static IExceptionServices Initialize() { return PlatformEnlightenmentProvider.Current.GetService<IExceptionServices>(Array.Empty<object>()) ?? new DefaultExceptionServices(); } } }