Skip to content

Commit

Permalink
update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Apr 12, 2024
1 parent f6d1c81 commit eaa5988
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vyper/semantics/analysis/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,14 @@ def check_module_uses(node: vy_ast.ExprNode) -> Optional[ModuleInfo]:

for module_info in module_infos:
if module_info.ownership < ModuleOwnership.USES:
msg = f"Cannot access `{module_info.alias}` state!"
msg = f"Cannot access `{module_info.alias}` state!\n note that"
# CMC 2024-04-12 add UX note about nonreentrant. might be nice
# in the future to be more specific about exactly which state is
# used, although that requires threading a bit more context into
# this function.
msg += " use of the `@nonreentrant` decorator is also considered"
msg += " state access"

hint = f"add `uses: {module_info.alias}` or "
hint += f"`initializes: {module_info.alias}` as "
hint += "a top-level statement to your contract"
Expand Down

0 comments on commit eaa5988

Please sign in to comment.