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

26 lines
273 B
Text
Raw Permalink Normal View History

2013-10-27 22:24:23 +00:00
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;
}