I am trying to catch a custom exception that is thrown inside the async method, but for some reason it always ends up in a common catch catch block. See code example below.
class Program { static void Main(string[] args) { try { var t = Task.Run(TestAsync); t.Wait(); } catch(CustomException) { throw; } catch (Exception) {
source share