RosettaCodeData/Task/Exceptions/Aime/exceptions-1.aime

26 lines
273 B
Plaintext

void
throwing(void)
{
o_text("throwing...\n");
error("now!");
}
void
catching(void)
{
o_text("ready to catch\n");
if (trap(throwing)) {
o_text("caught!\n");
} else {
# nothing was thrown
}
}
integer
main(void)
{
catching();
return 0;
}