Replies: 2 comments
-
On 7/19/22 20:13, peter mckinna wrote:
If I have a try finally inside a loop with an exit in the finally
clause and an exception is raised it gets absorbed by the exit and
^ between TRY and FINALLY?
And it's the original exception that gets lost, not the exit-exception?
This agrees with my reading o 2.3.8, TryFinally:
2.3.8 Try Finally
A statement of the form:
TRY S_1 FINALLY S_2 END
executes statement S_1 and then statement S_2. If the outcome of S_1 is normal, the
TRY statement is equivalent
to S_1; S_2. If the outcome of S_1 is an exception and the outcome of S_2 is normal, the exception from S_1 is re-raised after S_2 is executed. If both outcomes are exceptions, the outcome of the TRY the exception from S_2.
So if I understand the case correctly, the outcome of S_1 is the RAISEd exception
and the outcome of S_2 is the exit-exception. The last sentence applies, and
the outcome of the entire TRY-FINALLY is the exit-exception from S_2. And it's
implicit that the other exception is lost.
…
just gets lost? It seems strange, and the manual is a bit
coy on detail with the exit. It's similar to a return in the
finally but at least the manual mentions the return
exception being raised.
—
Reply to this email directly, view it on GitHub <#1035>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNAH3M5VFEEI4YAIEM3VU5HDVANCNFSM54B2IDPA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks,
This agrees with my test cases, so everything agrees with the
manual ie definition. It's just that information seems to be lost. It
almost suggests we need some sort of check for exception inside a finally
but I guess you can always wrap it in a try except. You just have to be
aware
of the pattern.
Regards Peter
On Tue, 11 Oct 2022 at 19:55, Rodney M. Bates ***@***.***>
wrote:
…
On 7/19/22 20:13, peter mckinna wrote:
>
> If I have a try finally inside a loop with an exit in the finally
> clause and an exception is raised it gets absorbed by the exit and
>
^ between TRY and FINALLY?
And it's the original exception that gets lost, not the exit-exception?
This agrees with my reading o 2.3.8, TryFinally:
2.3.8 Try Finally
A statement of the form:
TRY S_1 FINALLY S_2 END
executes statement S_1 and then statement S_2. If the outcome of S_1 is
normal, the
TRY statement is equivalent
to S_1; S_2. If the outcome of S_1 is an exception and the outcome of S_2
is normal, the exception from S_1 is re-raised after S_2 is executed. If
both outcomes are exceptions, the outcome of the TRY the exception from S_2.
So if I understand the case correctly, the outcome of S_1 is the RAISEd
exception
and the outcome of S_2 is the exit-exception. The last sentence applies,
and
the outcome of the entire TRY-FINALLY is the exit-exception from S_2. And
it's
implicit that the other exception is lost.
>
> just gets lost? It seems strange, and the manual is a bit
> coy on detail with the exit. It's similar to a return in the
> finally but at least the manual mentions the return
> exception being raised.
>
> —
> Reply to this email directly, view it on GitHub <
#1035>, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ABSVZNAH3M5VFEEI4YAIEM3VU5HDVANCNFSM54B2IDPA
>.
> You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#1035 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABALZXZ3RVR4Z24DVYKVSFTWCUTR3ANCNFSM54B2IDPA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I have a try finally inside a loop with an exit in the finally
clause and an exception is raised it gets absorbed by the exit and
just gets lost? It seems strange, and the manual is a bit
coy on detail with the exit. It's similar to a return in the
finally but at least the manual mentions the return
exception being raised.
Beta Was this translation helpful? Give feedback.
All reactions