Skip to content

Commit

Permalink
ux: reverse order in which exceptions are reported (#2838)
Browse files Browse the repository at this point in the history
this commit reverses the order in which multiple exceptions are
reported. this is a usability issue because sometimes when exceptions
cascade, the first error is the most meaningful (other errors depend on
the first error being fixed).
  • Loading branch information
charles-cooper committed May 4, 2022
1 parent e287a20 commit df2da62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vyper/exceptions.py
Expand Up @@ -18,7 +18,7 @@ def raise_if_not_empty(self):
raise self[0]
elif len(self) > 1:
err_msg = ["Compilation failed with the following errors:"]
err_msg += [f"{type(i).__name__}: {i}" for i in self]
err_msg += [f"{type(i).__name__}: {i}" for i in reversed(self)]
raise VyperException("\n\n".join(err_msg))


Expand Down

0 comments on commit df2da62

Please sign in to comment.