Proper way to find the innermost exception?

前端 未结 4 1947
孤独总比滥情好
孤独总比滥情好 2021-02-08 06:16

I\'m working with some classes which, when throwing, have a relatively deep InnerException tree. I\'d like to log and act upon the innermost exception which is the one having th

4条回答
  •  爱一瞬间的悲伤
    2021-02-08 06:51

    In a word, yes. I cannot think of any significantly better or different way of doing it. Unless you wanted to add it as an extension method instead, but it's really six of one, half-a-dozen of the other.

提交回复
热议问题