<PackageReference Include="Polly.Core" Version="8.4.1" />

DefaultPredicates<TArgs, TResult>

static class DefaultPredicates<TArgs, TResult> where TArgs : IOutcomeArguments<TResult>
using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Polly.Utils { internal static class DefaultPredicates<TArgs, [System.Runtime.CompilerServices.Nullable(2)] TResult> where TArgs : IOutcomeArguments<TResult> { [System.Runtime.CompilerServices.Nullable(new byte[] { 1, 1, 0 })] public static readonly Func<TArgs, ValueTask<bool>> HandleOutcome = delegate(TArgs args) { Exception exception = args.Outcome.Exception; if (exception is OperationCanceledException) return PredicateResult.False(); if (exception != null) return PredicateResult.True(); return PredicateResult.False(); }; } }