You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/13 07:57:36 UTC

[GitHub] [flink] dawidwys commented on issue #10838: [hotfix][table-common] Simplify formatted exceptions

dawidwys commented on issue #10838: [hotfix][table-common] Simplify formatted exceptions
URL: https://github.com/apache/flink/pull/10838#issuecomment-573546069
 
 
   This solution has one caveat that it is not very intuitive. I think we all (java coders) are used to passing the exception at the end. I'm afraid this solution might be surprising for a lot of newcomers.
   
   How about we rather add a builder:
   ```
   public static TableExceptionBuilder tableException(String format, Object... args);
   
   class TableExceptionBuilder {
       TableException cause(Throwable cause);
   
       TableException build();
   }
   ```
   
   Or if we want to get rid off the `build` method:
   
   ```
   class TableException {
       public static TableException tableException(String format, Object... args);
   
       public TableException cause(Throwable cause) {
           return new TableException(getMessage(), cause);
       }
   }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services