RosettaCodeData/Task/Exceptions/Sidef/exceptions.sidef

11 lines
262 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
try {
2023-12-16 21:33:55 -08:00
die "I'm dead!" # throws an exception
}
catch { |msg|
say "msg: #{msg}" # msg: I'm dead! at test.sf line 2.
2023-07-01 11:58:00 -04:00
}
2023-12-16 21:33:55 -08:00
say "I'm alive..."
die "Now I'm dead!" # this line terminates the program
say "Or am I?" # Yes, you are!