Exception filters is a new C# 6.0 feature. Visual Basic.NET and F# have this functionality for a long time. That is because exception filtering was implemented in CIL but not in C#. Now, this technique available for us. That’s how you can use it:
If Method throws an exception, catch block will first try to match type of the exception and then will evaluatewhen block. If an expression in when block is true, execution will go to the catch block. If not, the next catch block will be evaluated.