[
https://issues.apache.org/jira/browse/KAFKA-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14939848#comment-14939848
]
ASF GitHub Bot commented on KAFKA-2601:
---------------------------------------
GitHub user GabrielNicolasAvellaneda opened a pull request:
https://github.com/apache/kafka/pull/269
KAFKA-2601: ConsoleProducer tool shows stacktrace on invalid command
parameters
Signed-off-by: GabrielNicolasAvellaneda <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/GabrielNicolasAvellaneda/kafka KAFKA-2601-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/269.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #269
----
commit 06ec8e6de68b37f088ae68eb89fa137d10851496
Author: GabrielNicolasAvellaneda <[email protected]>
Date: 2015-10-01T13:48:35Z
Catch UnsupportedOptionException to show a friendly error message.
Signed-off-by: GabrielNicolasAvellaneda <[email protected]>
----
> ConsoleProducer tool shows stacktrace on invalid command parameters
> -------------------------------------------------------------------
>
> Key: KAFKA-2601
> URL: https://issues.apache.org/jira/browse/KAFKA-2601
> Project: Kafka
> Issue Type: Bug
> Components: tools
> Affects Versions: 0.8.2.1
> Reporter: Gabriel Nicolas Avellnaeda
> Priority: Minor
> Labels: easyfix
>
> Running kafka-console-producer tool with an invalid argument shows a full
> stack trace instead of a user-friendly error:
> {code}
> vagrant@vagrant-ubuntu-trusty-64:/vagrant/kafka/kafka_2.9.1-0.8.2.1$
> bin/kafka-console-producer.sh --zookeeper localhost:2181 --topic another-topic
> Exception in thread "main" joptsimple.UnrecognizedOptionException:
> 'zookeeper' is not a recognized option
> at
> joptsimple.OptionException.unrecognizedOption(OptionException.java:93)
> at
> joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:402)
> at
> joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:55)
> at joptsimple.OptionParser.parse(OptionParser.java:392)
> at
> kafka.tools.ConsoleProducer$ProducerConfig.<init>(ConsoleProducer.scala:216)
> at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:35)
> at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)