Похожие чаты

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 ответов

7 просмотров

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 👍

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

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

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
61
Добрый день, не подскажите, если в OC-V3 поменять страндартную директорию /storage/ на /storage2/ - не будет сильно много проблем ?
Max Dubovsky
32
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
25
Книга Юрова В.И пойдёт для обучения?
Botsman
24
Люди добрые, помогите с идеями, потому что свои закончились. У клиента падает софтина в момент инициализации модуля OtlEventMonitor на RegisterWindowMessage('Gp/OtlTaskEvents/...
Михаил Усков
7
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
> Примечательно, что новый владелец удаляет из GitHub любые жалобы, указывающие на подозрительную активность или смену владельца, и, видимо, рассчитывает на то, что пользовате...
Alex Sherbakov
2
Today, DENT achieved a significant step forward in DENTX adoption 🥳 Getting DENTX and starting staking is much easier: DENTX is available on Uniswap! Everyone can swap their ...
Thomas
3
I bought some PHA tokens on Kucoin, which is the best wallet to store and easy to use?
AMR
19
Карта сайта