-
Notifications
You must be signed in to change notification settings - Fork 298
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
dcrjson: update error types. #2271
Conversation
f92695c
to
4d5b9f1
Compare
4d5b9f1
to
0834be5
Compare
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.
The removal of the jsonerr.go
and associated errors isn't correct. These are error codes with very specific meaning to JSON-RPC that need to be retained.
Note that the old ErrorCode
cases are for the package API and those should be switched over (as you've done here). However, the "Standard JSON-RPC 2.0 errors", "General application defined JSON errors", etc, need to remain because those are codes that are required by the JSON-RPC specification.
To follow up, I believe
Then all of those errors would become:
You can see from the removed comment that there was once a separation between the two for this purpose:
I guess it was incorrectly changed at some point to shoehorn it into using the generic |
0834be5
to
da9bef9
Compare
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.
Just needs the copyright year updated on the modified files and then this is good to go.
This updates the dcrjson error types to leverage go 1.13 errors.Is/As functionality as well as confirm to the error infrastructure best practices.
da9bef9
to
d80953e
Compare
This updates the dcrjson error types to leverage go 1.13 errors.Is/As functionality as well as confirm to the error infrastructure best practices outlined in #2181.