Exceptions/Catch an exception thrown in a nested call: Difference between revisions
Content added Content deleted
(Remove Omit tag for Swift.) |
|||
Line 886: | Line 886: | ||
</pre> |
</pre> |
||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA 3. |
ELENA 3.4 : |
||
<lang elena>import extensions. |
<lang elena>import extensions. |
||
class U0 :: Exception. |
class U0 :: Exception. |
||
class U1 :: Exception. |
class U1 :: Exception. |
||
singleton Exceptions |
singleton Exceptions |
||
{ |
{ |
||
static int i. |
static int i. |
||
bar |
bar |
||
<= baz. |
<= baz. |
||
baz |
baz |
||
[ |
[ |
||
Line 910: | Line 910: | ||
] |
] |
||
] |
] |
||
foo |
foo |
||
[ |
[ |
||
Line 916: | Line 916: | ||
while (i < 2) |
while (i < 2) |
||
[ |
[ |
||
try( |
try(self bar) |
||
{ |
{ |
||
on(U0 e) |
on(U0 e) |
||
Line 923: | Line 923: | ||
] |
] |
||
}. |
}. |
||
i += 1. |
i += 1. |
||
] |
] |
||
] |
] |
||
} |
} |
||
public program |
|||
[ |
[ |
||
Exceptions foo. |
Exceptions foo. |
||
] |
]</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |