I have two questions:
If I have a method like this:
public void DoMyWork()
{
throw new MyException(anyString);
}
...and I call it async
like this:
public void DoMyWorkAsync()
{
try
{
new Thread(DoMyWork).Start();
}
catch (MyException)
{
// Do anything
}
}
First of all, will the exception be caught with a try-block like this? And if so, will the thread be ended, because normally with an exception the thread stops, but if I catch it, will it end, too, or do I have to implement a CancellationToken
then?