add the topic name information to the binder exception if a problem occurs in the provisioning phase

This commit is contained in:
ferblaca
2022-06-06 16:32:18 +02:00
committed by Soby Chacko
parent 607d30900b
commit e98cc5ce7d

View File

@@ -542,7 +542,8 @@ public class KafkaTopicProvisioner implements
if (ex instanceof UnknownTopicOrPartitionException) {
throw ex;
}
logger.error("Failed to obtain partition information", ex);
logger.error("Failed to obtain partition information for the topic "
+ "(" + topicName + ").", ex);
}
// In some cases, the above partition query may not throw an UnknownTopic..Exception for various reasons.
// For that, we are forcing another query to ensure that the topic is present on the server.
@@ -587,8 +588,8 @@ public class KafkaTopicProvisioner implements
});
}
catch (Exception ex) {
logger.error("Cannot initialize Binder", ex);
throw new BinderException("Cannot initialize binder:", ex);
logger.error("Cannot initialize Binder checking the topic (" + topicName + ").", ex);
throw new BinderException("Cannot initialize binder checking the topic (" + topicName + "):", ex);
}
}