Skip to content
New issue

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

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

Already on GitHub? # to your account

Add debug/release_assert overloads which output error message strings #3077

Merged
merged 3 commits into from
Feb 2, 2021

Conversation

wezrule
Copy link
Contributor

@wezrule wezrule commented Dec 31, 2020

The release_assert MACRO doesn't give an indication about what the actual error which caused it is, in the case of error codes it can be useful to know what they are. This adds a release_assert (and debug_assert) MACRO overload which accepts a string_view which will be output to the stderr in the case there is an error. This is now used in various places in database transactions for lmdb/rocksdb to catch more common issues seen. In blockstore_partial.hpp a new macro release_assert_success is added which conditionally creates the string as it could be wasteful to always construct it when it is only actually output in error cases.

@wezrule wezrule self-assigned this Dec 31, 2020
@wezrule wezrule added the debug Updates assisting with debugging and development efforts label Dec 31, 2020
@wezrule wezrule requested a review from SergiySW January 28, 2021 14:40
@wezrule wezrule added this to the V22.0 milestone Jan 28, 2021
@wezrule wezrule merged commit af28d69 into nanocurrency:develop Feb 2, 2021
@wezrule wezrule deleted the release_assert_with_string branch February 2, 2021 09:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
debug Updates assisting with debugging and development efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants