CoreTaskExtensionsObserveExceptionsTTask Method |
This method ensures the exception for a faulted task is "observed", i.e. the
Exception
property will be accessed if the task enters the
Faulted state.
Namespace: Rackspace.ThreadingAssembly: Rackspace.Threading (in Rackspace.Threading.dll) Version: 2.1.0-beta1
Syntax
public static TTask ObserveExceptions<TTask>(
this TTask task
)
where TTask : Task
<ExtensionAttribute>
Public Shared Function ObserveExceptions(Of TTask As Task) (
task As TTask
) As TTask
public:
[ExtensionAttribute]
generic<typename TTask>
where TTask : Task
static TTask ObserveExceptions(
TTask task
)
[<ExtensionAttribute>]
static member ObserveExceptions :
task : 'TTask -> 'TTask when 'TTask : Task
Parameters
- task
- Type: TTask
The antecedent task.
Type Parameters
- TTask
- The specific type of task.
Return Value
Type:
TTaskThe input argument
task.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Remarks
Prior to .NET 4.5, failing to observe the Exception property for a faulted task
would terminate the process.
Version Information
.NET for Windows Store apps
Supported in: Windows 8
.NET Framework
Supported in: 4.5, 4.0, 3.5
Portable Class Library
Supported in: Portable Class Library (Legacy), Portable Class Library
Threading Library
Supported in: 2.1, 2.0
See Also