How to Bubble Up Exception Information? : Easily Explained with Examples
You might have come across situations where we have to offload execution of some tasks to some other thread so that it can be done in the background. When this child thread is executed there might be situations where it throws exception and often these exceptions is unknown to the caller thread or the main thread. In those cases we need to bubble up the exception which is occurring in the child thread to the parent where it can be handled. What is meant by Bubble Up Exception Information? Bubbling up in simple terms can be related to the Air bubbles which makes its way to the surface from the bottom. In our case we are referring to the exception which occurs in the child thread to make its way up to the main thread where all the exceptions can be handled gracefully. There are different ways by which we can bubble up the exception information from the child thread to the main thread. In .Net 4.0 and above we can use Task through which it is much easier to achieve this as sho...