quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Picocli - Some expected errors lead to a stacktrace and they shouldn't

Open gsmet opened this issue 1 year ago • 1 comments

In the case of quarkus config enc, if I forget the parameter, I end up with a stacktrace which is not really expected: we should have a standard Picocli error output and not a full stacktrace as this is a standard use case of the CLI and not an underlying error.

$ quarkus config enc
2024-06-27 14:23:25,703 ERROR [io.qua.run.Application] (main) Failed to start application (with profile [prod]): picocli.CommandLine$MissingParameterException: Missing required parameter: 'SECRET'
	at picocli.CommandLine$Interpreter.assertNoMissingParameters(CommandLine.java:14930)
	at picocli.CommandLine$Interpreter.validateConstraints(CommandLine.java:13659)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13620)
	at picocli.CommandLine$Interpreter.processSubcommand(CommandLine.java:13915)
	at picocli.CommandLine$Interpreter.processArguments(CommandLine.java:13811)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13597)
	at picocli.CommandLine$Interpreter.processSubcommand(CommandLine.java:13915)
	at picocli.CommandLine$Interpreter.processArguments(CommandLine.java:13811)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13597)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13565)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13460)
	at picocli.CommandLine.parseArgs(CommandLine.java:1552)
	at io.quarkus.cli.QuarkusCli.checkMissingCommand(QuarkusCli.java:165)
	at io.quarkus.cli.QuarkusCli.run(QuarkusCli.java:109)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:132)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.cli.Main.main(Main.java:9)

gsmet avatar Jun 27 '24 12:06 gsmet

/cc @brunobat (opentelemetry,tracing), @ebullient (picocli), @radcortez (opentelemetry,tracing)

quarkus-bot[bot] avatar Jun 27 '24 12:06 quarkus-bot[bot]

This is not a problem with the Picocli extension but specific to the Quarkus CLI. PR in the works...

gsmet avatar Jul 02 '24 14:07 gsmet