MINOR: Add cause to thrown exception when deleting topic in TopicCommand
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
@@ -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)
}
}
}
