I want to know when "continueWhith" has exceptions.
I made a code like this.
Task.Factory.StartNew(() =>
{
if(HasException())
throw new Exception("Exception");
// Logic
}).ContinueWith(x =>
{
// Do something to UI.
}, CancellationToken.None, TaskContinuationOptions.NotOnFaulted,
_uiScheduler).continueWith(x =>
{
if (x.Exception.IsNotNull()) // Exception handling here.
ShowExceptionMessage(x.Exception);
}
I expected to there was an exception in the task at last continueWith, but it wasn't.
Is it right that there isn't an Exception in the Task at last continueWith?
and I want to know how to set an exception property in continueWith.
Thank you.