BackgroundWorker will automatically throw an exception. It is located in AsyncCompletedEventArgs.Error when the RunWorkerCompleted event is RunWorkerCompleted .
If you like, you can wrap and rebuild the exception in this event handler, keeping in mind that in the framework, in Invoke.
The exception that occurs in the background thread in a .NET application is a catastrophic error that can and will lead to the destruction of the whole process; the only way to handle this is to wrap all the actions in a try-catch block and save any exception that occurs, which is what BackgroundWorker does.
Aaronaught
source share