Browse Source

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 <wangguoz@gmail.com>
pull/7311/head
Jason Gustafson 5 years ago committed by GitHub
parent
commit
7b62248c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      core/src/main/scala/kafka/admin/TopicCommand.scala

4
core/src/main/scala/kafka/admin/TopicCommand.scala

@ -453,8 +453,8 @@ object TopicCommand extends Logging { @@ -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)
}
}
}

Loading…
Cancel
Save