You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "urbandan (via GitHub)" <gi...@apache.org> on 2023/06/06 10:20:41 UTC
[GitHub] [kafka] urbandan commented on a diff in pull request #13813: KAFKA-13756: Connect validate endpoint should return proper validatio…
urbandan commented on code in PR #13813:
URL: https://github.com/apache/kafka/pull/13813#discussion_r1219366831
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java:
##########
@@ -464,10 +465,22 @@ ConfigInfos validateConnectorConfig(Map<String, String> connectorProps, boolean
connectorProps = worker.configTransformer().transform(connectorProps);
}
String connType = connectorProps.get(ConnectorConfig.CONNECTOR_CLASS_CONFIG);
- if (connType == null)
- throw new BadRequestException("Connector config " + connectorProps + " contains no connector type");
+ if (connType == null) {
+ return createConnectorClassError("Config contains no connector type");
+ }
+
+ Connector connector;
+ try {
+ connector = getConnector(connType);
+ } catch (ConnectException e) {
+ return createConnectorClassError(e.getMessage());
Review Comment:
I agree. I was tempted to just remove the list of connectors as a whole, but there are other call sites where the exception message is logged. In case it can be useful for diagnostics, I added a parameter instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org