-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
private/mode/api: Add codegen typed Errors for RESTJSON and JSONRPC APIs #3062
Conversation
b0f208a
to
d081b04
Compare
5d59e7e
to
8eb1550
Compare
func NewUnmarshalErrorHandler(unmarshaler ErrorUnmarshaler) *UnmarshalErrorHandler { | ||
return &UnmarshalErrorHandler{ | ||
unmarshaler: unmarshaler, | ||
} | ||
} |
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.
constructor not needed here
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 purpose of these constructors is to reinforce the idea that the passed in parameters is a required parameter and the type must be created with its value. When doing struct initialization there is no clear signal what if anything is required members. This is the reason constructors may be preferred for initializing a type.
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.
Minor changes suggested
f68484e
to
3feee2a
Compare
Adds code generated error types for APIs using RESTJSON and JSONRPC protocol, and modeled errors. This adds generated error types that can be typed asserted to in order to read error values in addition to Code and Message.
d30a2ab
to
dc34276
Compare
Adds code generated error types for APIs using RESTJSON and JSONRPC protocol, and modeled errors. This adds generated error types that can be typed asserted to in order to read error values in addition to Code and Message.
TODO: