Похожие чаты

Task.WhenAll Will this return error when one of the task returns

error ?
Or it will be successful even if I task got success

6 ответов

20 просмотров

https://stackoverflow.com/questions/39589640/ignore-the-tasks-throwing-exceptions-at-task-whenall-and-get-only-the-completed

Say you have two tasks given to Task.WhenAll. One will throw an exception and the other will complete successfully. When used with Task.WhenAll, you'll finally get AggregateException thrown that wraps the exception of the first task. The second task will still complete and the AggregateException is thrown after the second succeeds.

you know you can press F1 on a method to go to the official documentation, rigth?

Athul-N Автор вопроса
luca flan di vedure
you know you can press F1 on a method to go to the...

I know I checked It doesn’t says it will throw any exception when the task gets failed

Athul N
I know I checked It doesn’t says it will throw any...

remarks section say > The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state. whenany returns the first task that completed, simply also im not bashing, but simply writing a test is literally shorter than the question you asked var test = await Task.WhenAny(Task.FromException(new Exception()), Task.Delay(1));

Athul-N Автор вопроса

Ok 👍

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта