If you run that example code in Visual Studio, you will indeed get the message MyCustomException was unhandled by user code
and Visual Studio will break in that line.
That does not mean that your exception is really unhandled. It just means that, by default, Visual Studio breaks on exceptions which are not handled inside the Task. You can verify this by running your application without debugging (Ctrl-F5); you will note that your exception gets handled as expected.
This issue is described in more detail in the following SO question: