Skip to content

Soltest error handling refactor #16014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: soltest-cleanup
Choose a base branch
from

Conversation

cameel
Copy link
Member

@cameel cameel commented Apr 19, 2025

Depends on #16013.

More refactors extracted from #16012, this time not purely cosmetic:

  • Replaces throwing std::runtime_error with dedicated exception types.
    • Unlike runtime_error, the new types can be used with solThrow()/solRequire() because they inherit from util::Exception.
    • We can now easily distinguish them from unhandled exceptions caused by bugs and handle them more gracefully, by just printing the message, without all the debug info clutter. This makes the assembly parsing errors from evmasm test case #16012 much more readable.
  • Prevents the infinite update loop when your custom test case does not add a newline at the end of expectations (a common mistake).
  • Also, prints a hint when the expectations don't match but look identical, because the difference is only in whitespace.
  • Tweaks a few messages and changes the output from stdout to stderr in some cases.

@cameel cameel added testing 🔨 has dependencies The PR depends on other PRs that must be merged first refactor labels Apr 19, 2025
@cameel cameel self-assigned this Apr 19, 2025
@cameel cameel force-pushed the refactor-soltest-error-handling branch from fc66d33 to 0c1a327 Compare April 19, 2025 08:09
@cameel cameel force-pushed the refactor-soltest-error-handling branch from 0c1a327 to caeaa48 Compare April 19, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has dependencies The PR depends on other PRs that must be merged first refactor testing 🔨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant