From 7b62248c6219937727e059cd4ecf020d9188894e Mon Sep 17 00:00:00 2001 From: Jason Gustafson Date: Fri, 6 Sep 2019 09:44:15 -0700 Subject: [PATCH] MINOR: Add cause to thrown exception when deleting topic in TopicCommand (#7301) Unexpected exceptions are caught during topic deletion in `TopicCommand`. The caught exception is currently lost and we raise `AdminOperationException`. This patch fixes the problem by chaining the caught exception. Reviewers: Guozhang Wang --- core/src/main/scala/kafka/admin/TopicCommand.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/kafka/admin/TopicCommand.scala b/core/src/main/scala/kafka/admin/TopicCommand.scala index 986e555cc83..9123d492953 100755 --- a/core/src/main/scala/kafka/admin/TopicCommand.scala +++ b/core/src/main/scala/kafka/admin/TopicCommand.scala @@ -453,8 +453,8 @@ object TopicCommand extends Logging { println(s"Topic $topic is already marked for deletion.") case e: AdminOperationException => throw e - case _: Throwable => - throw new AdminOperationException(s"Error while deleting topic $topic") + case e: Throwable => + throw new AdminOperationException(s"Error while deleting topic $topic", e) } } }