Skip to content
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

Helpful Remediation in Known Error Situation #1115

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

bmarcaur
Copy link
Member

Helped someone debug this locally. Figured adding these "docs" inline might save someone grief in the future.

@@ -139,13 +139,20 @@ private static Path getJdkPath(Project project) {
.map(Path::of)
.map(sdkHome -> sdkHome.resolve("bin").resolve("java" + (SystemInfo.isWindows ? ".exe" : "")))
.filter(Files::exists)
.orElseThrow(() -> new IllegalStateException("Could not determine jdk path for project " + project));
.orElseThrow(() ->
new IllegalStateException("Could not determine JDK path for project: " + project.getName()));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing the project directly creates error messages like so:

Could not determine jdk version for project Project(name=product, containerState=COMPONENT_CREATED, componentStore=/path/to/product)

Which feels slightly leaky and generally not that useful.

@bmarcaur bmarcaur force-pushed the bmarcaurele/helpful-error-with-empty-sdk branch from c542ca7 to 00cc924 Compare August 13, 2024 17:14
@bmarcaur bmarcaur force-pushed the bmarcaurele/helpful-error-with-empty-sdk branch from 00cc924 to f674ea9 Compare August 13, 2024 17:26
@bulldozer-bot bulldozer-bot bot merged commit 58af349 into develop Aug 14, 2024
7 checks passed
@bulldozer-bot bulldozer-bot bot deleted the bmarcaurele/helpful-error-with-empty-sdk branch August 14, 2024 11:25
@svc-autorelease
Copy link
Collaborator

Released 2.50.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants