"Exception Filters"

static void Test() {
	try {
		SomeOperation();
	}
	catch (Exception e) when (e.InnerException is OperationCanceledException oce) {
		Console.WriteLine($"Operation was cancelled: {oce}");
	}
}


Code snippet taken from "Complete C# Quick Reference - C# 5 and C# 6".