-
-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include more detailed exception information when Exception is AggregateException #2087
Comments
Which version on Cake are you using, have you tried executing Cake with diagnostic verbosity? |
If changing the verbosity affects it, I would wonder is it ever helpful to see only the message in the special case of an AggregateException? |
@jnm2 Issue could be that it's already within an aggregate exception because the async support. So could be an extra layer of abstraction. Whereas diagnostic gives the whole stack trace. |
@devlead It is an extra layer of abstraction because he is using |
Well anything's possible would need to be recursive then I guess. to fetch inner inner exception messages and so on too. |
I wonder if Ben Adams magic exception demystifier exists as a source package... 😄 |
Some issue here; |
Given that the code already tries to handle |
cake-build#2087 When the exception thrown in a task is actually a nested `AggregateException`, the output log is: ``` An error occurred when executing task 'taskName'. Error: One or more errors occurred. One or more errors occurred. ``` The first occurence of `One or more errors occurred.` is the message of the parent `AggregateException`. The second occurence is the message if the inner exception, which is itself another `AggregateException`. Here we add a call to `.Flatten()`. This creates a new single instance of `AggregateException` without nesting, so that the last log line will now show the actual inner exception message. Reference: https://docs.microsoft.com/en-us/dotnet/api/system.aggregateexception.flatten?view=netframework-4.7.2
cake-build#2087 When the exception thrown in a task is actually a nested `AggregateException`, the output log is: ``` An error occurred when executing task 'taskName'. Error: One or more errors occurred. One or more errors occurred. ``` The first occurence of `One or more errors occurred.` is the message of the parent `AggregateException`. The second occurence is the message if the inner exception, which is itself another `AggregateException`. Here we add a call to `.Flatten()`. This creates a new single instance of `AggregateException` without nesting, so that the last log line will now show the actual inner exception message. Reference: https://docs.microsoft.com/en-us/dotnet/api/system.aggregateexception.flatten?view=netframework-4.7.2
I have Tasks that will execute a Parallel.Invoke of an array of Actions. However, when an error happens, all I'll see is the "One or more errors occured". Maybe AggregateExceptions should output the message of each child exception.
The text was updated successfully, but these errors were encountered: