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

chore: improve syntax error messages #3885

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Mar 23, 2024

What I did

Fix #3865

The exception now displays as:

vyper.exceptions.SyntaxException: invalid syntax (<unknown>, line 3)

  line 3:31 
       2 def foo():
  ---> 3     s: String[2] = staticcall staticcall concat('a', 'b')
  --------------------------------------^
       4     return

How I did it

How to verify it

Not sure how to go about writing a test for this

Commit message

chore: improve syntax error handling

This PR improves the handling of syntax errors by obscuring
the underlying exception from the python parser.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.36%. Comparing base (f8d4b97) to head (fc261ce).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3885   +/-   ##
=======================================
  Coverage   86.36%   86.36%           
=======================================
  Files          92       92           
  Lines       14024    14024           
  Branches     3081     3081           
=======================================
  Hits        12112    12112           
  Misses       1484     1484           
  Partials      428      428           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@charles-cooper charles-cooper changed the title chore: improve syntax error handling chore: improve syntax error messages Mar 23, 2024
@charles-cooper charles-cooper enabled auto-merge (squash) March 23, 2024 11:11
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

thanks!

@charles-cooper charles-cooper merged commit 224b2c3 into vyperlang:master Mar 23, 2024
146 checks passed
electriclilies pushed a commit to electriclilies/vyper that referenced this pull request Apr 27, 2024
This commit improves the handling of syntax errors by hiding the
underlying exception from the python parser.
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.

await kw displayed to end users when error reporting
3 participants