-
Notifications
You must be signed in to change notification settings - Fork 12k
[ISSUE #2206] Fix the issue can not throw the right exception #2213
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
Conversation
| protocolByte = (byte) Integer.parseInt(protocol); | ||
| System.out.println(protocolByte); |
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.
IMO, we should delete these two codes.
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 method SerializeType.valueOf() need a byte type parameter.It will get a wrong result when we put a String type parameter.
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.
You are right , just delete System.out.println(protocolByte);.
| } catch (IllegalArgumentException e) { | ||
| throw new RuntimeException("parser specified protocol error. protocol=" + protocol, e); | ||
| throw new RuntimeException("parser specified protocol error. protocol=" + serializeTypeConfigInThisServer, e); | ||
| } |
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.
IMO, No need to catch the runtime exception and rethrow it
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.
Okay,I will fix it.
| @@ -0,0 +1,22 @@ | |||
| package org.apache.rocketmq.remoting.protocol; | |||
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.
Missing ASF license header
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.
Thx,I have fixed it.
| } catch (IllegalArgumentException e) { | ||
| throw new RuntimeException("parser specified protocol error. protocol=" + protocol, e); | ||
| e.printStackTrace(); | ||
| } |
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.
IMO, no need to catch Runtime exception.
|
This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. |
|
This PR was closed because it has been inactive for 3 days since being marked as stale. |
What is the purpose of the change
fix the issue#2206
Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyleto make sure basic checks pass. Runmvn clean install -DskipITsto make sure unit-test pass. Runmvn clean test-compile failsafe:integration-testto make sure integration-test pass.