You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems as though WhenAll immediately fails with an exception if any awaited task throws an exception, instead of waiting for all the tasks to complete and then throwing the exception. I believe this is different than normal Task behavior which would wait until all tasks are completed regardless of whether some of them failed.
This was unexpected behavior for me because I am expecting some tasks to fail occasionally, but I still need to know that all tasks are done before continuing. I understand from #335 that WhenAll doesn't store the exceptions for individual tasks, but I think it should not convert to WhenAny just because one task failed...perhaps it could store the first exception that happened and then re-throw that when all tasks are done?
Or, is there some way I'm missing to wait for all tasks to complete regardless of failure?
The text was updated successfully, but these errors were encountered:
Yes, the reason WhenAll behaves differently than Task.WhenAll is due to a failure in my initial design.
I would like to fix it, but am having trouble thinking of a way to do so because it would break compatibility.
If it helps, I recently solved this problem in my promise library by adding Promise.AllSettled to match the javascript method. You could do the same by adding WhenAllSettled.
It seems as though WhenAll immediately fails with an exception if any awaited task throws an exception, instead of waiting for all the tasks to complete and then throwing the exception. I believe this is different than normal Task behavior which would wait until all tasks are completed regardless of whether some of them failed.
This was unexpected behavior for me because I am expecting some tasks to fail occasionally, but I still need to know that all tasks are done before continuing. I understand from #335 that WhenAll doesn't store the exceptions for individual tasks, but I think it should not convert to WhenAny just because one task failed...perhaps it could store the first exception that happened and then re-throw that when all tasks are done?
Or, is there some way I'm missing to wait for all tasks to complete regardless of failure?
The text was updated successfully, but these errors were encountered: