Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): better error message when putting parentheses in a catch block #6589

Merged
merged 4 commits into from
May 30, 2024

Conversation

tsuf239
Copy link
Contributor

@tsuf239 tsuf239 commented May 29, 2024

Fixes #5945

try {
  log("Hello World");
} catch (e) {
//      ^^^ Unexpected parentheses in catch block. Use 'catch e' instead of 'catch (e)'.
  log("error");
}

try {
  log("Hello World");
} catch (longError) {
//      ^^^^^^^^^^^ Unexpected parentheses in catch block. Use 'catch longError' instead of 'catch (longError)'.
  log("error");
}
image

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@tsuf239 tsuf239 requested a review from a team as a code owner May 29, 2024 12:02
Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@tsuf239 tsuf239 changed the title fix(compiler): better error message when putting in parenthesis in a catch block fix(compiler): better error message when putting in parentheses in a catch block May 29, 2024
@tsuf239 tsuf239 changed the title fix(compiler): better error message when putting in parentheses in a catch block fix(compiler): better error message when putting parentheses in a catch block May 29, 2024
@monadabot
Copy link
Contributor

monadabot commented May 29, 2024

Console preview environment is available at https://wing-console-pr-6589.fly.dev 🚀

Last Updated (UTC) 2024-05-29 12:19

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 29, 2024
@tsuf239 tsuf239 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 29, 2024
Copy link
Contributor

@yoav-steinberg yoav-steinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

libs/tree-sitter-wing/grammar.js Show resolved Hide resolved
Copy link
Contributor

mergify bot commented May 30, 2024

Thanks for contributing, @tsuf239! This PR will now be added to the merge queue, or immediately merged if tsuf/better-error-try-catch-parenthesis is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request May 30, 2024
@mergify mergify bot merged commit f323a4b into main May 30, 2024
15 checks passed
@mergify mergify bot deleted the tsuf/better-error-try-catch-parenthesis branch May 30, 2024 07:27
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.74.24.

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.

Confusing error message when putting error in parenthesis in try-catch block
4 participants