Exceptions/Catch an exception thrown in a nested call: Difference between revisions

Content added Content deleted
(→‎{{header|Go}}: Add a much simpler Go example.)
Line 50: Line 50:


=={{header|Aime}}==
=={{header|Aime}}==
{{incorrect|Aime|Logic should test for U0 and pass other exceptions}}
<lang aime>void
<lang aime>void
baz(integer i, text &exception)
baz(integer i, text &exception)
Line 74: Line 73:


if (trap(bar, i, e)) {
if (trap(bar, i, e)) {
o_text("Exception `");
o_form("Exception `~' thrown\n", e);
o_text(e);
if (e != "U0") {
o_text("' thrown\n");
if (!compare(e, "U1")) {
o_text("will not catch exception\n");
o_text("will not catch exception\n");
error(e);
error(e);