4 ms·
edit: Apparently [0] is for VB.net and C++ but I would think including VB.net would mean the CLR. If so, then C# should be the same. A further SO post on the to
by pests 12y ago
edit: Apparently [0] is for VB.net and C++ but I would think including VB.net would mean the CLR. If so, then C# should be the same. A further SO post on the topic with no official sources confirms the same at [1]
---
Found more details at [0]
Apparently the CLR runtime catches them and then causes your exception filter to return false, as if you had done so yourself.
[0] https://msdn.microsoft.com/en-US/library/ms182337%28v=vs.80%29.aspx https://msdn.microsoft.com/en-US/library/ms182337%28v=vs.80%...
[1] http://stackoverflow.com/questions/28879320/what-happens-if-the-filter-of-an-exception-filter-throws-an-exception http://stackoverflow.com/questions/28879320/what-happens-if-...
- TeMPOraL 12y agoGood find, thanks! Returning false in this situation feels a bit hacky IMO.
- pests 12y agoI found another interesting gotcha in regards to the filter step of exception handling described at [0]. Its in VB but describes the CLR two-pass exception handling and how filter functions and finally blocks interact with regards to state. [0] http://blogs.msdn.com/b/dotnet/archive/2009/08/25/the-good-and-the-bad-of-exception-filters.aspx http://blogs.msdn.com/b/dotnet/archive/2009/08/25/the-good-a...
- pests 12y agoTo respond to your point, I think its the only way to go. The filter function that throws could be attached to any catch block all the way up the call stack. Where exactly would you start the search for a exception handler in that case?