Exception Filters : Exception filters are a CLR capability that is exposed in Visual Basic and F#, but hasn’t been in C# – until now. If the parenthesized expression after ‘if’ evaluates to true, the catch block is run, otherwise the exception keeps going. Basically Exception Filter is one of the new features of C# 6.0 that allows us to specify a conditional clause for each catch block. In other words now we can write a catch block that will handle the exception of a specific type only when a certain condition is true that is written in an exception filter clause. First we see a code snippet of an Exception Filter then we will learn more about it.
staticvoid Main(string args)
//throw new ArgumentNullException("Arg2");
catch (ArgumentNullException ex) if (ex.Message.Contains("Arg1"