RosettaCodeData/Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Mathematica/exceptions-catch-an-exception-thrown-in-a-nested-call.math
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

7 lines
148 B
Text

foo[] := Catch[ bar[1]; bar[2]; ]
bar[i_] := baz[i];
baz[i_] := Switch[i,
1, Throw["Exception U0 in baz"];,
2, Throw["Exception U1 in baz"];]