FWLamb commented on code in PR #3594:
URL:
https://github.com/apache/incubator-seatunnel/pull/3594#discussion_r1034241620
##########
seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/source/HttpSource.java:
##########
@@ -62,7 +65,9 @@ public Boundedness getBoundedness() {
public void prepare(Config pluginConfig) throws PrepareFailException {
CheckResult result = CheckConfigUtil.checkAllExists(pluginConfig,
HttpConfig.URL.key());
if (!result.isSuccess()) {
- throw new PrepareFailException(getPluginName(), PluginType.SOURCE,
result.getMsg());
+ throw new
HttpConnectorException(SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
+ String.format("PluginName: %s, PluginType: %s, Message:
%s",
+ getPluginName(), PluginType.SINK,
result.getMsg()));
Review Comment:
```suggestion
getPluginName(), PluginType.SOURCE,
result.getMsg()));
```
##########
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:
Use `CommonErrorCode ILLEGAL_ ARGUMENT` may be better.
--
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]