class TryExpr def main is shared x = 0 x = try int.parse('123') catch FormatException get 0 assert x == 123 val ='11213' x = try int.parse(val) catch FormatException get 0 assert x == 11213 val1 ='foo' x = try int.parse(val1) catch FormatException get 666 assert x == 666 x=0 val1 ='foo1' x = try int.parse(val1) catch FormatException get 666 assert x == 666 # all exceptions x = try int.parse(val1) catch get 667 assert x == 667