using System;
public class Test
{
public static void Main()
{
//Demo
try
{
throw new CustomException_A();
}
catch(Exception e)
{
switch(e)
{
case CustomException_A e_a:
Console.WriteLine("Flow_A");
break;
case CustomException_B e_b:
Console.WriteLine("Flow_B");
break;
default:
Console.WriteLine("Flow_Default");
break;
}
}
// your code goes here
}
}
public class CustomException_A : Exception
{
public CustomException_A() : base() {}
}
public class CustomException_B : Exception
{
public CustomException_B() : base() {}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCS8vRGVtbwoJCXRyeSAKCQl7CgkJCXRocm93IG5ldyBDdXN0b21FeGNlcHRpb25fQSgpOwoJCX0KCQljYXRjaChFeGNlcHRpb24gZSkKCQl7CgkJCXN3aXRjaChlKQoJCQl7CgkJCQljYXNlIEN1c3RvbUV4Y2VwdGlvbl9BIGVfYToKCQkJCQlDb25zb2xlLldyaXRlTGluZSgiRmxvd19BIik7CgkJCQkJYnJlYWs7CgkJCQljYXNlIEN1c3RvbUV4Y2VwdGlvbl9CIGVfYjoKCQkJCQlDb25zb2xlLldyaXRlTGluZSgiRmxvd19CIik7CgkJCQkJYnJlYWs7CgkJCQkJCgkJCQlkZWZhdWx0OgoJCQkJCUNvbnNvbGUuV3JpdGVMaW5lKCJGbG93X0RlZmF1bHQiKTsKCQkJCQlicmVhazsKCQkJfQoJCX0KCQkKCQoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCX0KfQpwdWJsaWMgY2xhc3MgQ3VzdG9tRXhjZXB0aW9uX0EgOiBFeGNlcHRpb24KewoJcHVibGljIEN1c3RvbUV4Y2VwdGlvbl9BKCkgOiBiYXNlKCkge30KfQpwdWJsaWMgY2xhc3MgQ3VzdG9tRXhjZXB0aW9uX0IgOiBFeGNlcHRpb24KewoJcHVibGljIEN1c3RvbUV4Y2VwdGlvbl9CKCkgOiBiYXNlKCkge30KfQ==