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

feat[ux]: move exception hint to the last position #4154

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cyberthirst
Copy link
Collaborator

@cyberthirst cyberthirst commented Jun 16, 2024

What I did

  • moved the (hint: ...) to be reported as the last item to improve the readability
  • the hint should be displayed after the actual problem has been described, ie, as the last item

example:

original:

vyper.exceptions.InvalidOperation: Cannot perform decimal division on uint256

  (hint: did you mean `10 // 4`?)

  contract "tests/custom/test.vy:3", function "f", line 3:17 
       2 def f(x: Bytes[32*5]):
  ---> 3     k: uint256 = 10 / 4
  ------------------------^

new order:

vyper.exceptions.InvalidOperation: Cannot perform decimal division on uint256

  contract "tests/custom/test.vy:3", function "f", line 3:17 
       2 def f(x: Bytes[32*5]):
  ---> 3     k: uint256 = 10 / 4
  ------------------------^

  (hint: did you mean `10 // 4`?)

edit: fix the example

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

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

@cyberthirst
Copy link
Collaborator Author

Given how close the 0.4.0 release is, I think it might be wise to merge after the release.

@cyberthirst cyberthirst marked this pull request as draft June 16, 2024 08:05
@@ -95,11 +95,33 @@ def hint(self):
return self._hint()
return self._hint

@property
def annotation_message(self):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def annotation_message(self):
def annotated_message(self):

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.

None yet

2 participants