I think the point is to understand that the exceptions that occur in the thread will not be passed to the calling thread for processing.
, , :
private static void RebelWithoutACause()
{
throw new NullReferenceException("Can't touch this!");
}
, , , , try/catch:
private static void Main(string[] args)
{
try
{
var thread = new Thread(RebelWithoutACause);
thread.Start();
thread.Join();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
, , , catch, , , .
, , . , , .