According to the MSDN Task.WaitAll via AggregateException, as soon as an exception occurs during the execution of at least one instance task. I need to wait until all tasks are processed with every exception thrown. So I need to do something like:
while (true) { try { Task.WaitAll(tasks); break; //only if no exception is occured } catch (AggregateException aex) { //exceptions handling... } }
or is it a more rational way?
The docs don't say WaitAll returns as soon as one exception is thrown. The opposite is true: he is always waiting for all tasks to be completed.
WaitAll
Expects all provided task objects to complete.
This is the behavior you want.
Source: https://habr.com/ru/post/1502634/More articles:why does transaction-type = "JTA" call "the WebBeans context with the region type annotation @RequestScoped does not exist in the current thread"? - javaC # How to use a MemoryStream with multithreading - multithreadingIs it possible to exclude Java Servlet to exclude application launch? - javaCannot start standalone selenium server - selenium-gridAdd HTML to JUnit reports - junitКак добавить ссылки href в теги или в Jenkins/JUNIT xml - htmlInsert after deleting the same transaction in Spring Data JPA - spring-dataScala Play Framework Slick session not working - scalaIs extending classes a good practice? - phpwhy html element is displayed only when loading all css files - htmlAll Articles