InnerException type comparison in ExceptionSummarizer ignores BaseType #4585
Unanswered
KalleOlaviNiemitalo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Microsoft.Extensions.Diagnostics.ExceptionSummarization, ExceptionSummarizer.Summarize first searches for an IExceptionSummaryProvider registered for the exception type or a base type of that. For example, a provider registered for COMException can be used for DirectoryServicesCOMException as well.
If that did not find an IExceptionSummaryProvider, but there is an InnerException, then ExceptionSummarizer.Summarize checks for a provider registered for the type of the inner exception. Here though, it checks only the exact type and does not follow the Type.BaseType chain. Is that by design?
extensions/src/Libraries/Microsoft.Extensions.Diagnostics.ExceptionSummarization/ExceptionSummarizer.cs
Lines 50 to 61 in 042cc42
Related to issue #4004 and pull request #4370.
Beta Was this translation helpful? Give feedback.
All reactions