We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using this (perfectly legit ) java hack :
public interface ExceptionUtils { /** * Rethrow an {@link java.lang.Throwable} preserving the stack trace but making it unchecked. * * @param exception to be re-thrown as unchecked. */ static void rethrowUnchecked(final Throwable eexception{ rethrow(exception); } @SuppressWarnings("unchecked") private static <T extends Throwable> void rethrow(final Throwable t) throws T { throw (T) t; } }
This would remove the need for always having to wrap check exceptions such as IORuntimeException and possibly others, preserving a clean stack trace:
try { //... } catch(IOException e) { // throw new IORuntimeException(e); ExceptionUtils.rethrowUnchecked(e); }
The text was updated successfully, but these errors were encountered:
Good idea to circumvent the checked exception mess.
If we consider using this solution, it would be a breaking change in our APIs. I will add this to the next major release milestone.
Sorry, something went wrong.
No branches or pull requests
Consider using this (perfectly legit ) java hack :
This would remove the need for always having to wrap check exceptions such as IORuntimeException and possibly others, preserving a clean stack trace:
The text was updated successfully, but these errors were encountered: