fix(gax): implement getMessage() in FlowController exceptions - #14077
fix(gax): implement getMessage() in FlowController exceptions#14077NiranjanKumar001 wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request overrides the getMessage() and toString() methods in MaxOutstandingElementCountReachedException and MaxOutstandingRequestBytesReachedException within FlowController.java, and adds a test case to verify their outputs. The reviewer recommends passing the formatted message to the superclass constructor via super(message) instead of overriding these methods, which aligns with standard Java exception handling practices and ensures proper serialization and logging.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors FlowControlException and its subclasses (MaxOutstandingElementCountReachedException and MaxOutstandingRequestBytesReachedException) to pass exception messages to the superclass constructor instead of overriding toString(), and adds corresponding unit tests. The review feedback recommends changing the visibility of the new FlowControlException constructor from protected to private to preserve the API design constraint that prevents external subclassing, since nested subclasses can still access private constructors.
…x/batching/FlowController.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors FlowController exceptions to pass formatted error messages to the parent FlowControlException constructor instead of overriding toString(), and adds a test to verify these messages. The review feedback correctly identifies a grammatical error in the exception messages, suggesting changing 'have been reached' to 'has been reached' and updating the corresponding test assertions for consistency. All comments are constructive and should be addressed.
…x/batching/FlowController.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…x/batching/FlowController.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…x/batching/FlowControllerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…x/batching/FlowControllerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the exceptions in FlowController to pass formatted error messages to the parent Exception constructor instead of overriding toString(), and adds a corresponding unit test. The review feedback suggests making the new test method public to ensure it is executed properly under JUnit 4.
…x/batching/FlowControllerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the exceptions in FlowController to pass descriptive error messages to the parent FlowControlException constructor instead of overriding toString(), and adds unit tests to verify these messages. The reviewer feedback suggests removing the now-unused no-argument constructor in FlowControlException and replacing String.format with string concatenation in the exception constructors to avoid performance overhead in high-throughput scenarios.
…with concatenation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates FlowController's custom exceptions (MaxOutstandingElementCountReachedException and MaxOutstandingRequestBytesReachedException) to pass descriptive error messages to their superclass constructor instead of overriding toString(). Additionally, a unit test has been added to verify that getMessage() returns the correct error messages. There are no review comments, so no further feedback is provided.
Fixes #12950