public class FooException : Exception { } public class BarException : FooException { } public static class Test { public static void Throw() throws FooException { throw BarException("foo"); } public static bool Run() { return true; } }