using System;
void ThrowIfTrue(bool param) {
try {
if (param) {
throw new Exception("test exception");
}
}
catch{
Console.WriteLine("catch");
}
finally {
Console.WriteLine("finally");
}
}
ThrowIfTrue(true);
//печатается: "catch" и "finally"
ThrowIfTrue(false);
//печатается только "finally"
Console.ReadLine();