-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(exit): throw TronError if JDK does not support #6455
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
| AnsiConsole.systemUninstall(); | ||
| throw new TronError(e, TronError.ErrCode.JDK_VERSION); | ||
| } | ||
| clearParam(); // reset all parameters to avoid the influence in test |
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 name throwIfUnsupportedJavaVersion can be modified as checkJdkCompatible ?
What's the output of three lines related with AnsiConsole ?
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.
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.
If you want to show this infomation in console, this AnsiConsole should be placed in ExitManager, so all TronError has the same action.
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.
To avoid confusion caused by silent execution when using -h or -v flags, errors are explicitly logged to the console in this context. Console output is not required for errors in other scenarios.
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.
| "1.8 ", getOsArch(), javaSpecificationVersion())); | ||
| "Java %s is required for %s architecture. Detected version %s", "1.8", | ||
| getOsArch(), javaSpecificationVersion())); | ||
| } |
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 write Java 1.8 directly ?
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.
I believe either style is fine.
d79e879 to
b582eea
Compare
b582eea to
f1d1b4a
Compare
What does this PR do?
Replace the UnsupportedOperationException with TronError if the JDK does not support.
Why are these changes required?
This PR has been tested by:
Follow up
Extra details