File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1673,6 +1673,18 @@ module Operators =
16731673 | s when s.Equals( ciString, StringComparison.InvariantCultureIgnoreCase) -> Some ()
16741674 | _ -> None
16751675
1676+ /// <summary >
1677+ /// An active pattern to match AggregateException and extract its inner exceptions as a list.
1678+ /// </summary >
1679+ /// <category index =" 23 " >Additional Functions</category >
1680+ let (| AggregateException | _ |) ( exn : exn ) : exn list option =
1681+ let exn = nullArgCheck ( nameof exn) exn
1682+
1683+ match exn with
1684+ | :? AggregateException as aex -> aex.InnerExceptions |> Seq.toList |> Some
1685+ | _ -> None
1686+
1687+
16761688 /// <summary >
16771689 /// Safely dispose a resource (includes null-checking).
16781690 /// </summary >
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ module Task =
1010 open FSharpPlus.Tests .Helpers
1111
1212 exception TestException of string
13-
14- let (| AggregateException | _ |) ( x : exn ) =
15- match x with
16- | :? AggregateException as e -> e.InnerExceptions |> Seq.toList |> Some
17- | _ -> None
1813
1914 module TaskTests =
2015
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ module ValueTask =
1010 open FSharpPlus.Tests .Helpers
1111
1212 exception TestException of string
13-
14- let (| AggregateException | _ |) ( x : exn ) =
15- match x with
16- | :? AggregateException as e -> e.InnerExceptions |> Seq.toList |> Some
17- | _ -> None
1813
1914 type ValueTask < 'T > with
2015 static member WhenAll ( source : ValueTask < 'T > seq ) = source |> Seq.map ( fun x -> x.AsTask ()) |> Task.WhenAll |> ValueTask< 'T []>
You can’t perform that action at this time.
0 commit comments