add error_code constants#2151
Conversation
GitGab19
left a comment
There was a problem hiding this comment.
I looked on the specs and reported almost on every "message" the error_code(s) that we have there, to simplify the review and being sure we're covering all we have on the specs.
That said, I think my initial understanding was to define the error codes (as constants) only for the ones which are explicitly defined in the current specs.
But reviewing this PR made me realize that probably your goal was to cover all the codes we have on the specs + everything we are already using at the application level (which very likely would be useful also for some adopters).
Is my understanding correct?
as of today, SRI already implements this PR covers all I cannot say I introduced all I've always treated the so whenever I was faced with some edge case that the spec didn't explicitly list, I just established the |
|
I see, and I guess it makes sense. My question now is: should we have constants for all the error-codes which are currently listed on the specs? Even if they are not currently used by our implementation? |
This comment was marked as outdated.
This comment was marked as outdated.
3393943 to
2f9f21e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4eaf07c to
2296dd6
Compare
|
@GitGab19 FYI since your last review I'm doing some additional changes here, which are one extra step aligned with the vision described in #2149 (comment) more specifically, with 4d80cc5 I'm making sure that error but not all error variants carry a /// Variants carrying `&'static str` are intended to be used as `error_code` values in the response message.
///
/// Variants without `&'static str` SHOULD lead to a client disconnection or application
/// shutdown.
/// ...
|
3648297 to
f96d975
Compare
|
reproducing #2151 (comment):
perhaps @GitGab19 's intention was more of a rethorical question to point out the issues we discussed around nevertheless, it might be worth addressing the question for the sake of clarity on this PR
|
GitGab19
left a comment
There was a problem hiding this comment.
Now it looks way better, very good job!
I only left a couple of nits.
e8c3ef2 to
47f7822
Compare
47f7822 to
79eb7a8
Compare
close #2142
companion stratum-mining/sv2-apps#495