-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(jsonrpc): jsonrpc set error resolver #6369
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
base: release_v4.8.1
Are you sure you want to change the base?
feat(jsonrpc): jsonrpc set error resolver #6369
Conversation
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 modify JsonRpcInternalException itself?
Do not modify TronException.
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 modify JsonRpcInternalException itself? Do not modify TronException.
Thank you for your suggestion. I have added a JsonRpcException as the parent class for JSON-RPC exceptions, which makes it easier to extend the data field for all JSON-RPC exceptions. d575241
Like |
|
||
@Getter | ||
public class JsonRpcException extends TronException { | ||
private Object data = null; |
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.
why not define data's type as byte[] ?
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.
Object is more general than byte[], I think
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.
Yes, use the Object type because it is more flexible and can support various kinds of data.
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.
get it.
What does this PR do?
Support setting of data field when jsonrpc return error, from #6330
Why are these changes required?
This PR has been tested by:
Follow up
Extra details