Please have a look at the following code-
static void Main(string[] args)
{
// Get the task.
var task = Task.Factory.StartNew(() => { r
Since you are using tasks you should get AggregateException which wraps all exceptions occured during execution. You see One or more errors occurred message, because it's default output of AggregateException.ToString() method.
You need Handle method of the exception's instance.
Also see the right approach to handle such exceptions here.