Skip to content

fix try/finally not re-throwing errors when there is no catch clause#1692

Merged
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
RealColdFry:fix/try-finally-rethrow
Mar 24, 2026
Merged

fix try/finally not re-throwing errors when there is no catch clause#1692
Perryvw merged 2 commits intoTypeScriptToLua:masterfrom
RealColdFry:fix/try-finally-rethrow

Conversation

@RealColdFry
Copy link
Contributor

Fixes #1667

When a try block had a finally but no catch, pcall's error result was discarded, silently swallowing the exception. Now the error is captured and re-thrown after the finally block executes.

…ypeScriptToLua#1667)

When a try block had a finally but no catch, pcall's error result was
discarded, silently swallowing the exception. Now the error is captured
and re-thrown after the finally block executes.
@Perryvw Perryvw merged commit cfb6e2b into TypeScriptToLua:master Mar 24, 2026
8 checks passed
@RealColdFry RealColdFry deleted the fix/try-finally-rethrow branch March 26, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

try finally without catch should throw error in try block if no return in finally

2 participants