Since C# 6 you can now do this.
try { … }
catch (MyException e) when (myfilter(e))
{
…
}
This is different from using an if
statement from within the catch
block, using exception filters will not unwind the stack.
More Related Contents:
- Writing to txt file reach out of memory ? C# [closed]
- How to get the type of T from a member of a generic class or method
- Set global hotkeys using C#
- How do I prevent and/or handle a StackOverflowException?
- Nested using statements in C#
- How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?
- How to calculate distance similarity measure of given 2 strings?
- Detect target framework version at compile time
- Execute multiple command lines with the same process using .NET
- Get all controls of a specific type
- Am I Running as a Service
- The opposite of Intersect()
- Convert Dictionary To Anonymous Object?
- Convert DataTable to generic List?
- System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005
- Async and await – difference between console, Windows Forms and ASP.NET
- Difference between System.DateTime.Now and System.DateTime.Today
- Removing hidden characters from within strings
- Image.FromStream() method returns Invalid Argument exception
- How to know if a line intersects a rectangle
- How do I spawn threads on different CPU cores?
- Get List element position in c# using LINQ
- How to Async Files.ReadAllLines and await for results?
- Bluetooth APIs in Windows/.Net?
- ContextMenuStrip.Owner Property null When Retrieving From Nested ToolStripMenuItem
- AddIdentity vs AddIdentityCore
- Best way to limit the number of active Tasks running via the Parallel Task Library
- How can I determine browser window size on server side C#
- How do I get a Video Thumbnail in .Net?
- BitArray – Shift bits