std::error_code and std::expected implementation #942
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is in preparation of the IPC/API patch, @clemahieu suggested it be a separate patch.
These docs are still mostly valid (the std::excpected impl changed to a more robust one):
https://github.com/cryptocode/raiblocks/wiki/Error-handling-in-the-node-using-std::error_code-and-std::expected
Lee already did some reviewing of the RPC version of this PR: #801
I've started to use the
nano
namespace both here and in the upcoming API patch, to make it consistent with the API clients, which all use nano namespace/package naming. If that works well, we can do a transition of the remaining rai namespace.The common error codes added is a starting point which is useful for the API patch; these will be expanded as needed.