[sdk/java] improve exception output
Open
Nobody has claimed this yet.
area/sdks
impact/usability
kind/enhancement
language/java
- Dominant language
- Java
- Stars
- 85
- Forks
- 26
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 22
Description
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Was reviewing https://github.com/pulumi/examples/pull/1260
The error message could be better.
pulumi:pulumi:Stack (gcp-java-gke-hello-world-dev):
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.pulumi:gcp-java-gke-hello-world >-----------------
[INFO] Building gcp-java-gke-hello-world 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gcp-java-gke-hello-world ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kdixler/Documents/examples/gcp-java-gke-hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gcp-java-gke-hello-world ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ gcp-java-gke-hello-world ---
Aug 10, 2022 8:16:53 AM com.pulumi.deployment.internal.DeploymentImpl$DefaultEngineLogger errorAsync
SEVERE: Running program [PID: 217938](/usr/lib/jvm/java-11-openjdk/bin/java -classpath /opt/maven/boot/plexus-classworlds-2.6.0.jar -Dclassworlds.conf=/opt/maven/bin/m2.conf -Dmaven.home=/opt/maven -Dlibrary.jansi.path=/opt/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/kdixler/Documents/examples/gcp-java-gke-hello-world org.codehaus.plexus.classworlds.launcher.Launcher --no-transfer-progress compile exec:java) failed with an unhandled exception:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Optional.java:382)
at gcpgke.App.stack(App.java:94)
at com.pulumi.internal.PulumiInternal.lambda$runAsyncResult$2(PulumiInternal.java:77)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
error: Running program [PID: 217938](/usr/lib/jvm/java-11-openjdk/bin/java -classpath /opt/maven/boot/plexus-classworlds-2.6.0.jar -Dclassworlds.conf=/opt/maven/bin/m2.conf -Dmaven.home=/opt/maven -Dlibrary.jansi.path=/opt/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/kdixler/Documents/examples/gcp-java-gke-hello-world org.codehaus.plexus.classworlds.launcher.Launcher --no-transfer-progress compile exec:java) failed with an unhandled exception:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.orElseThrow(Optional.java:382)
at gcpgke.App.stack(App.java:94)
at com.pulumi.internal.PulumiInternal.lambda$runAsyncResult$2(PulumiInternal.java:77)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
error: an unhandled error occurred: '/usr/bin/mvn /usr/bin/mvn --no-transfer-progress compile exec:java' exited with non-zero exit code: 32
Work items
- #763
- deduplicate error output(likely stderr/stdout)
- trim stacktrace
- improve missing config value error message(indicate the missing config value and how to set it)
Affected area/feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Maven execution failure shown in the issue and inspect the Java stack entry at gcpgke.App.stack(App.java:94) alongside the PulumiInternal.runAsyncResult path. The listed work items define completion: deduplicate stderr/stdout output, trim the stack trace, and make missing-config errors identify the value and how to set it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100