besu icon indicating copy to clipboard operation
besu copied to clipboard

Add more details to --rpc-http-apis error message

Open daniellehrner opened this issue 3 years ago • 0 comments
trafficstars

Description

When I enter an invalid value for --rpc-http-apis or --rpc-ws-apis I get for example the following error:

picocli.CommandLine$ParameterException: Invalid value for option '--rpc-http-apis'
	at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:1306)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
	at picocli.CommandLine.parseWithHandlers(CommandLine.java:2559)
	at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:54)
	at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31)
	at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
	at picocli.CommandLine.parseWithHandlers(CommandLine.java:2559)
	at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1457)
	at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1266)
	at org.hyperledger.besu.Besu.main(Besu.java:49)
Caused by: picocli.CommandLine$ParameterException: Invalid value for option '--rpc-http-apis'
	at org.hyperledger.besu.cli.BesuCommand.validateRpcOptionsParams(BesuCommand.java:1663)
	at org.hyperledger.besu.cli.BesuCommand.validateOptions(BesuCommand.java:1585)
	at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:1289)
	... 14 more

This error message could be more helpful by telling me which parameter is not valid, especially if I have entered several

Acceptance Criteria

  • The above error message should output which parameters are invalid

daniellehrner avatar Feb 13 '22 17:02 daniellehrner