TaskExtensions.SwallowException(Task) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Swallow exceptions for event handlers. http://theburningmonk.com/2012/10/c-beware-of-async-void-in-your-code/
We need to read an Exception to prevent throwing an Exception for .NET 4.0 and below. See http://stackoverflow.com/questions/25691114/where-does-an-async-task-throw-exception-if-it-is-not-awaited
public:
[System::Runtime::CompilerServices::Extension]
static void SwallowException(System::Threading::Tasks::Task ^ task);
public static void SwallowException (this System.Threading.Tasks.Task task);
static member SwallowException : System.Threading.Tasks.Task -> unit
<Extension()>
Public Sub SwallowException (task As Task)
Parameters
- task
- Task
Task to swallow exception for