Method Throw
Throw<TSource>(Exception)
Returns a sequence that throws an exception upon enumeration.
Declaration
public static IAsyncEnumerable<TSource> Throw<TSource>(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception to throw upon enumerating the resulting sequence. |
Returns
Type | Description |
---|---|
IAsync |
Sequence that throws the specified exception upon enumeration. |
Type Parameters
Name | Description |
---|---|
TSource | Source sequence element type. |
Remarks
The provided value (exception
) will be thrown when the first element is enumerated.
If the returned IAsync
Exceptions
Type | Condition |
---|---|
Argument |
|