Aggregate exceptions
See original GitHub issueGreat library! Biggest problem with doing good work is people raise awkward questions! Sorry.
What’s the best way to handle AggregateExceptions? I’m using Service Fabric and Serilog for all my logging. Lots of cross service exceptions are exposed as AggregateExceptions and they still produce a generally old fashioned stack trace.
I’ve got something working by just logging the inner exception, but that seems like I’m handling the problem at the wrong level. I think Demystify should handle the aggregate exception internally.
This change in Demystify may work - does it make sense?
if (exception is AggregateException aex)
{
foreach (var innerException in aex.InnerExceptions)
{
innerException.Demystify();
}
}
else
{
exception.InnerException?.Demystify();
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
exception - AggregateException C# example
AggregateException is often used for catching exceptions, that might occur when waiting for a Task to complete. Because Task in general can ...
Read more >How to Throw Multiple Exceptions at Once, Using ...
An aggregate exception therefore, is an single exception that is composed of multiple separate exceptions. How do I create an aggregate ...
Read more >AggregateException.Flatten Method (System)
Flatten method to rethrow the inner exceptions from multiple AggregateException instances thrown by multiple tasks in a single AggregateException instance, as ...
Read more >Debugging System.AggregateException - even in async code
As the name implies, AggregateException is used to batch one or more exceptions together in a single exception. In this post, I'll show...
Read more >How to fix unhandled AggregateException - YouTube
This video explains why AggregateException catch block never reached when Exception is raised during Tasks execution ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Much better - thanks for the quick response! Wish I had this a few years ago.
Version 0.0.4 is on NuGet https://www.nuget.org/packages/Ben.Demystifier/0.0.4