You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
try/finally does not behave as expected when rethrowing #1137
Activity
hepiyellow commentedon Jun 7, 2023
Just to clarify and simplify.
The issue is that the Finally block is not getting called.
This TypeScript code when compiled with
tsc:Produces this output:
The equivalent code in TSTL
Produces this output:
The
finallyblock is NOT called 😞thautwarm commentedon Sep 14, 2023
bumpthautwarm commentedon Sep 14, 2023
throw not working in thetryblock whenfinallyis presented.thautwarm commentedon Sep 14, 2023
Above code smoothly gives me
hepiyellow commentedon Sep 14, 2023
@thautwarm The above code you show seems to be doing what is expected.
The problem starts when you re-throw an error in the
catchblock.The output is:
The
finallyblock is not called 😞thautwarm commentedon Sep 17, 2023
I apologize for this. I didn't recognize this issue is not related to my question.
Fix try/catch/finally flow (#1729)