garydgregory commented on PR #1156:
URL: https://github.com/apache/commons-lang/pull/1156#issuecomment-1887209144

   You can also "erase" exceptions. See 
[org.apache.commons.io.function.Erase](https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/function/Erase.java):
   
   ```
      void foo() {
           try {
              // Something that throws IOException
           } catch (final IOException ex) {
               rethrow(ex); // throws IOException
           }
      }
   ...
       @SuppressWarnings("unchecked")
       public static <T extends Throwable> RuntimeException rethrow(final 
Throwable throwable) throws T {
           throw (T) throwable;
       }
   
   ```
   


-- 
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]

Reply via email to