RosettaCodeData/Task/Exceptions/Aime/exceptions-1.aime
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

25 lines
273 B
Text

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;
}