FWLamb commented on code in PR #3594:
URL:
https://github.com/apache/incubator-seatunnel/pull/3594#discussion_r1034294039
##########
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
Agree with you.If more format types are supported later, we can point out in
the error message so that users can know which formats are supported.
--
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]