You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "gharris1727 (via GitHub)" <gi...@apache.org> on 2023/06/05 18:13:43 UTC

[GitHub] [kafka] gharris1727 commented on a diff in pull request #13813: KAFKA-13756: Connect validate endpoint should return proper validatio…

gharris1727 commented on code in PR #13813:
URL: https://github.com/apache/kafka/pull/13813#discussion_r1218424942


##########
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 believe this message includes a list of suggested classes. I think that the recommended values is the right way to return this data, so we may choose to omit it from the error messages thrown on this code path.
   
   WDYT?



-- 
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