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

(Remove Omit tag for Swift.)
Line 886:
</pre>
=={{header|Elena}}==
ELENA 3.2.14 :
<lang elena>import extensions.
 
class U0 :: Exception.
 
class U1 :: Exception.
 
singleton Exceptions
{
static int i.
bar
<= baz.
 
baz
[
Line 910:
]
]
foo
[
Line 916:
while (i < 2)
[
try($self bar)
{
on(U0 e)
Line 923:
]
}.
i += 1.
]
]
}
 
programpublic =program
[
Exceptions foo.
].</lang>
{{out}}
<pre>
Anonymous user