Created
April 10, 2017 23:55
-
-
Save adamv/cb9eee14dea592dee1d62f48c92edc13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stuff { | |
void method() { | |
/*.. in a catch block ..*/ | |
throw translate(ex); | |
} | |
@SuppressWarnings("UnusedReturnValue") | |
private static RuntimeException translate(Exception ex) | |
throws SomeCheckedException, SomeOtherException { | |
if (ex instanceof SomeException) { | |
throw new SomeCheckedException(ex); | |
} else { | |
throw new SomeOtherException(ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment