TyrantLucifer commented on code in PR #3594:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3594#discussion_r1034291687


##########
seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/source/HttpSource.java:
##########
@@ -83,7 +88,7 @@ protected void buildSchemaWithConfig(Config pluginConfig) {
                     break;
                 default:
                     // TODO: use format SPI
-                    throw new UnsupportedOperationException("Unsupported 
format: " + format);
+                    throw new 
HttpConnectorException(HttpConnectorErrorCode.FORMAT_FAILED, new 
UnsupportedOperationException());

Review Comment:
   As for now, all connectors will use `CommonErrorCode.ILLEGAL_ARGUMENT` when 
handling this class exception, this exception can be understood as having 
incorrect parameters. So `CommonErrorCode.ILLEGAL_ARGUMENT` could be better. We 
can throw exception with clear error tips like the following shown:
   
   ```java
   throw new HttpConnectorException(CommonErrorCode.ILLEGAL_ARGUMENT, 
String.format("Unsupported data format [%s], http connector only support json 
format now", format));
   ```
   
   What do you think about it? @MonsterChenzhuo @FWLamb 
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to