jbangdev / jbang

Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.
https://jbang.dev
MIT License
1.44k stars 159 forks source link

feat: when no jdk installable show possible reasons/erros #1824

Closed maxandersen closed 3 months ago

maxandersen commented 3 months ago

in https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/JBang.20failure/near/455708888 @gsmet had this happen:

Error:  [ERROR] JDK version is not available for installation: 21
Use 'jbang jdk list --available' to see a list of JDKs available for installation
[jbang] Run with --verbose for more details
Error: Process completed with exit code 2.

as it happens in github he can't really easily re-run with verbose to get info why failed.

This PR tries without having to reorganize the whole call chain and print out last possible exception for each provider.

quintesse commented 3 months ago

I think you added a bit more to this PR than necessary :-)

maxandersen commented 3 months ago

I think you added a bit more to this PR than necessary :-)

whoops. fixed. i hope.

quintesse commented 3 months ago

whoops. fixed. i hope.

Yes!

Now for the PR itself, let me think about it, because you've just given the providers ephemeral state and that wasn't really the idea (configuration state, okay, anything else, hmmm 🤔 ).

maxandersen commented 3 months ago

updated this to just have jdk provider that uses foojay to print explicit message if errror happens. should suffice.