Exemplo n.º 1
0
 /// <summary>
 /// Catches exceptions of type <typeparamref name="TException"/>.
 /// </summary>
 /// <example>
 /// <code>
 /// IAsyncEnumerable&lt;int> source = ...;
 /// var catched = source
 ///     .Select(i => new { X = i, Y = 2 * i }) // anonymous type
 ///     .Timeout(TimeSpan.FromSeconds(5))
 ///     .Catch(default(TimeoutException)); // Catch&lt;anonymous, TimeoutException>(...)
 /// </code>
 /// </example>
 public static IAsyncEnumerable <TSource> Catch <TSource, TException>(this IAsyncEnumerable <TSource> source, TException _) where TException : Exception
 => source.Catch <TSource, TException>();