How to catch the Exception raised by subthread?

Hi all,
I create some threads in main thread, and sometimes, the subthread will raise exceptions, how can I catch those Exceptions in main thread? is it possible?

Thanks.

[178 byte] By [Handi] at [2007-12-16]
# 1
You can use the new BackgroundWorker component in .NET 2.0. It takes care of passing in arguments to the background thread, reporting progress back to the main thread, and returning the result or exception.

However, there's a little bug in Beta 2, and returning an Exception is not working as specified, but you can work around that by return the exception as the result.

This component is also available for .NET 1.x, just google for it.

DanielRieck at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...