[ 
https://issues.apache.org/jira/browse/BEAM-3677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17546786#comment-17546786
 ] 

Kenneth Knowles commented on BEAM-3677:
---------------------------------------

This issue has been migrated to https://github.com/apache/beam/issues/18617

> Declare proper exception type in catch block of 
> KafkaExactlyOnceSink#initShardWriter
> ------------------------------------------------------------------------------------
>
>                 Key: BEAM-3677
>                 URL: https://issues.apache.org/jira/browse/BEAM-3677
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-kafka
>            Reporter: Ted Yu
>            Priority: P3
>
> {code}
>       } catch (Exception e) {
>         producer.close();
>         throw e;
> {code}
> initShardWriter throws IOException. The catch block shouldn't widen the 
> exception type.
> If the intention is to properly close producer, we can use try-with-resources.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to