Click or drag to resize
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.Threading
Assembly: Rackspace.Threading (in Rackspace.Threading.dll) Version: 2.1.0-beta1
Syntax
public static TTask ObserveExceptions<TTask>(
	this TTask task
)
where TTask : Task

Parameters

task
Type: TTask
The antecedent task.

Type Parameters

TTask
The specific type of task.

Return Value

Type: TTask
The 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
ExceptionCondition
ArgumentNullExceptionIf task is .
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