-
-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix[ux]: fix empty hints in error messages (#4351)
remove empty hint message from exceptions. this regression was introduced in 03095ce. the root cause of the issue, however, was that `hint=""` could be constructed in the first place. this commit fixes the `get_levenshtein_error_suggestions` helper so that it returns `None` on failure to find a suggestion rather than the empty string `""`. --------- Co-authored-by: Charles Cooper <[email protected]>
- Loading branch information
1 parent
dbf9fa0
commit 7d54f32
Showing
3 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from vyper import compiler | ||
from vyper.exceptions import UnknownType | ||
|
||
|
||
def test_unknown_type_exception(): | ||
code = """ | ||
@internal | ||
def foobar(token: IERC20): | ||
pass | ||
""" | ||
with pytest.raises(UnknownType) as e: | ||
compiler.compile_code(code) | ||
assert "(hint: )" not in str(e.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters