Open dixler opened 2 years ago
regarding:
improve missing config value error message(indicate the missing config value and how to set it)
ctx.config.get("bleh")
returns an Optional
so there is no error, and ctx.config.require("bleh")
works as expected:
Diagnostics:
pulumi:pulumi:Stack (random-java-random):
error: Missing required configuration variable 'random:bleh'
please set a value using the command `pulumi config set random:bleh <value>`
error: an unhandled error occurred: '/usr/local/bin/mvn /usr/local/bin/mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn --no-transfer-progress compile exec:java' exited with non-zero exit code: 32
Aug 26, 2022 10:55:52 AM com.pulumi.deployment.internal.DeploymentImpl$DefaultEngineLogger errorAsync
SEVERE: Missing required configuration variable 'random:bleh'
please set a value using the command `pulumi config set random:bleh <value>`
please let me know what improvements you've had in mind :)
I've made a small change that should address the most visible problem of perceived duplication.
After changes:
Pawes-MacBook-Pro:random pprazak$ pulumi up
Please choose a stack, or create a new one: java-random
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Previewing update (java-random):
Type Name Plan Info
pulumi:pulumi:Stack random-java-random 1 error; 16 messages
Diagnostics:
pulumi:pulumi:Stack (random-java-random):
[ERROR] COMPILATION ERROR :
[ERROR] /Users/pprazak/repos/pulumi-java/tests/examples/random/src/main/java/com/pulumi/example/random/App.java:[29,13] cannot find symbol
symbol: method ctxexport(java.lang.String,com.pulumi.core.Output<java.lang.String>)
location: class com.pulumi.example.random.App
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project random: Compilation failure
[ERROR] /Users/pprazak/repos/pulumi-java/tests/examples/random/src/main/java/com/pulumi/example/random/App.java:[29,13] cannot find symbol
[ERROR] symbol: method ctxexport(java.lang.String,com.pulumi.core.Output<java.lang.String>)
[ERROR] location: class com.pulumi.example.random.App
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
error: an unhandled error occurred: '/usr/local/bin/mvn /usr/local/bin/mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn --no-transfer-progress compile exec:java' exited with non-zero exit code: 1
Also pulumi about
no longer display exceptions by default:
Pawes-MacBook-Pro:random pprazak$ pulumi about
CLI
Version 3.38.0
Go Version go1.19
Go Compiler gc
Plugins
NAME VERSION
java unknown
Host
OS darwin
Version 12.4
Arch x86_64
This project is written in java: executable='/Users/pprazak/.jenv/shims/java' version='openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)' javac='11.0.11' maven='Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)' gradle='7.5.1' java='/Users/pprazak/.jenv/shims/java'
Backend
Name Pawes-MacBook-Pro.local
URL file://~
User pprazak
Organizations
No dependencies found
Pulumi locates its logs in /var/folders/nr/rqhf2hvn3wn8q_mjysz2gq6m0000gn/T/ by default
warning: Failed to get information about the current stack: No current stack
Hello!
Issue details
Was reviewing https://github.com/pulumi/examples/pull/1260
The error message could be better.
Work items
Affected area/feature