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

m
(→‎{{header|C}}: Us of U1 & U2 aids comparison)
Line 314:
In conclusion, try/throw/catch keywords are not available in C, nor is
their functionality, so while the following code tries to fulfill the task's
requirements, no attempt is made to minicmimic them. The goal has been to provide
some modicum level of usefulness for someone actually looking at this for
ideas for their own code.
{{incomplete|C|Missing use of U1 & U2}}
U0 and U1 are boring for debugging purposes. Added something to help with that.
 
Line 384 ⟶ 383:
void baz(int n) {
if (! n) {
Push_Ex(GLOBALEX, U0_DRINK_ERROR , "U0 Drink Error. Insufficient drinks in bar Baz.");
return;
}
else {
Push_Ex(GLOBALEX, U1_ANGRYBARTENDER_ERROR , "U1 Bartender Error. Bartender kicked customer out of bar Baz.");
return;
}
Line 446 ⟶ 445:
Bar door is open.
Bar door is closed.
I am foo() and I deaall wrth U0 DriNk Errors with my own bottle... GOT oNE! [U0 Drink Error. Insufficient drinks in bar Baz.]
Foo left the bar.
Foo entering bar again.
Bar door is open.
Bar door is closed.
*** Error: U1 Bartender Error. Bartender kicked customer out of bar Baz.
</lang>
 
Anonymous user