Skip to content

Generate valid catch clauses for Python and JavaScript - #23

Merged
mikebarkmin merged 1 commit into
openpatch:mainfrom
mattibat:fix/catch-clause
Sep 28, 2026
Merged

mikebarkmin merged 1 commit into
openpatch:mainfrom
mattibat:fix/catch-clause

Conversation

@mattibat

Copy link
Copy Markdown
Contributor

New Try/Catch nodes default to Exception e, which was passed through as-is to every language:

Before After
Python except Exception e: except Exception as e:
JavaScript catch (Exception e) catch (e)

Both "before" lines are syntax errors. Java is unchanged.

Text that doesn't match Type name (e.g. ValueError as e) is left as written for Python; JavaScript always uses the last identifier.

@mikebarkmin
mikebarkmin merged commit d0bc7d1 into openpatch:main Sep 28, 2026
1 check passed
@mikebarkmin

Copy link
Copy Markdown
Member

lgtm

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.

2 participants