[ 
https://issues.apache.org/jira/browse/FLINK-30929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martijn Visser updated FLINK-30929:
-----------------------------------
    Fix Version/s:     (was: 1.15.0)

> Add helpful message when ElasticsearchSink.Builder.build() throws an 
> IllegalArgumentException.
> ----------------------------------------------------------------------------------------------
>
>                 Key: FLINK-30929
>                 URL: https://issues.apache.org/jira/browse/FLINK-30929
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / ElasticSearch
>    Affects Versions: 1.13.6
>            Reporter: Kenny Wu
>            Priority: Major
>         Attachments: image-2023-02-06-21-28-37-835.png
>
>
> When I test flink-connector-elasticsearch on my project. And *I got an 
> IllegalArgumentException with nothing helpful message.* 
> *Here's the exception message:* 
>  
> {code:java}
> Exception in thread "main" java.lang.IllegalArgumentException
>     at 
> org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:122)
>     at 
> org.apache.flink.streaming.connectors.elasticsearch7.Elasticsearch7ApiCallBridge.<init>(Elasticsearch7ApiCallBridge.java:61)
>     at 
> org.apache.flink.streaming.connectors.elasticsearch7.ElasticsearchSink.<init>(ElasticsearchSink.java:74)
>     ... {code}
>  
> *I could not see which exactly the argument was illegal.*
> After I read the code in (Elasticsearch7ApiCallBridge.java:61), I realized 
> that proberbly  the ES hosts was empty. And finally fixed it.
> !image-2023-02-06-21-28-37-835.png!
> I think helpful message should be printed when such an important argument is 
> illegal and fails to build the connector.
> And I'd love to improve it. thanks
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to