In the following code, an `async` method is called without being awaited. What is the primary issue with this approach to exception handling?
.NET interview question for Advanced practice.
Answer
The exception thrown inside ProcessDataAsync will become an 'unobserved task exception' that may crash the application because the Task it returns is never awaited.
Explanation
When ProcessDataAsync is called without await, its execution starts but the StartOperation method does not wait for it to complete. If the returned Task then throws an exception, that exception is stored on the Task object. Since the Task is never awaited or observed, the exception becomes an 'unobserved task exception'. In modern .NET, this will typically terminate the entire application process.