Exceptions/Catch an exception thrown in a nested call: Difference between revisions
Content added Content deleted
m (→{{header|D}}: pre not lang) |
(→{{header|Ada}}: U1 left unhandled) |
||
Line 39: | Line 39: | ||
Foo; |
Foo; |
||
end loop; |
end loop; |
||
exception |
|||
when U1 => |
|||
Put_line("Exception U1 passed through foo"); |
|||
end Exceptions_From_Nested_Calls;</lang> |
end Exceptions_From_Nested_Calls;</lang> |
||
Sample output: |
Sample output: |
||
<pre> |
<pre> |
||
Procedure Foo caught exception U0 |
Procedure Foo caught exception U0 |
||
Exception U1 passed through foo</pre> |
|||
raised EXCEPTIONS_FROM_NESTED_CALLS.U1 : exceptions_from_nested_calls.adb:13 |
|||
</pre> |
|||
=={{header|D}}== |
=={{header|D}}== |