A failing CHECK_NONFATAL
will throw an exception. This is fine and even desired in production builds, because the program may catch the exception and give the user a way to easily report the bug upstream.
However, in debug development builds, exceptions for internal bugs are problematic:
- The exception could accidentally be caught and silently ignored
- The exception does not include a full stacktrace, possibly making debugging harder
Fix all issues by turning the exception into an abort in debug builds.
This can be tested by reverting the hunks to src/rpc/node.cpp
and test/functional/rpc_misc.py
and then running the functional or fuzz tests.