-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Graceful error handling in soltest/isoltest + improved soltestAssert() #12283
Conversation
2ff6cfd
to
a970f9f
Compare
a970f9f
to
8f692a6
Compare
8f692a6
to
eab8b3a
Compare
eab8b3a
to
8de47e6
Compare
Rebased on |
8de47e6
to
0bb2050
Compare
Has conflicts |
Still has conflicts. |
Just needs a rebase (and another look from @christianparpart :)). Otherwise it should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, apart from the very minors. :)
- Allow omitting description. - Provide a default description. - Use a custom exception type derived from util::Exception rather than std::exception.
0bb2050
to
b3048cc
Compare
Ready for another round of review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great. thanks. :-)
Fixes #11917.
While working on #12282 I hit an assertion in
ByteUtils
but it looked like something completely different. That's becausesoltestAssert()
throwsstd::runtime_error
rather than some special exception type reserved for assertions. I also noticed that in #12019 I did not coversoltestAssert()
. This PR refactors the macro to be in line withsolAssert()
, i.e. allow skipping the message, provide a default message and use a dedicated exception type.I have also added exception handlers that intercept normal errors (like command-line validation errors) and print them in a way that does not make you think you hit a bug.
Also,
--help
no longer returns an error code. It's normal and expected behavior. A similar change was made forsolc
in #12118.I recommend reviewing with the option to ignore whitespace changes enabled - changes are actually small but some blocks had to be reindented due to the added
try
/catch
.