Skip to content

Commit

Permalink
include class name in exception error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Aug 9, 2024
1 parent a731764 commit 44df97a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vyper_lsp/analyzer/AstAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,13 @@ def get_diagnostics(self, doc: Document) -> List[Diagnostic]:
compiler_data = CompilerData(doc.source)
compiler_data.annotated_vyper_module
except VyperException as e:
# make message string include class name
message = f"{e.__class__.__name__}: {e}"
if e.lineno is not None and e.col_offset is not None:
diagnostics.append(diagnostic_from_exception(e))
else:
for a in e.annotations:
diagnostics.append(diagnostic_from_exception(a, message=e.message))
diagnostics.append(diagnostic_from_exception(a, message=message))
for warning in w:
m = deprecation_pattern.match(str(warning.message))
if not m:
Expand Down

0 comments on commit 44df97a

Please sign in to comment.