when failing to compile a vyper file, show the formatted message.
this will include line numbers whenever applicable!
fixes: #71
errors looks like this now:
UndeclaredDefinition:'hello' has not been declared
contract "contract_undeclared_variable.vy", function "foo1", line 5:4
4 def foo1() -> bool:
---> 5 hello = world
-----------^
6 return True
notice the line nos
How I did it
use formattedMessage instead of message when it is present.
How to verify it
take a contract like this:
@external
def foo1() -> bool:
hello = world
return True
try to compile it:
ape compile
you should see an error like this now:
ERROR: (VyperCompileError) und.vy
UndeclaredDefinition:'hello' has not been declared.
contract "und.vy:5", function "foo1", line 5:4
4 def foo1() -> bool:
---> 5 hello = world
-----------^
6 return True
before, it was just something like
ERROR: (VyperCompileError) und.vy
UndeclaredDefinition:'hello' has not been declared.
yay
Checklist
[ ] Passes all linting checks (pre-commit and CI jobs)
[ ] New test cases have been added and are passing
[ ] Documentation has been updated
[ ] PR title follows Conventional Commit standard (will be automatically included in the changelog)
What I did
when failing to compile a vyper file, show the formatted message. this will include line numbers whenever applicable!
fixes: #71
errors looks like this now:
notice the line nos
How I did it
use
formattedMessage
instead ofmessage
when it is present.How to verify it
take a contract like this:
try to compile it:
you should see an error like this now:
before, it was just something like
yay
Checklist