I have some code that might throw both checked and runtime exceptions.
I\'d like to catch the checked exception and wrap it with a runtime exception. But if a Runtim
Guava's Throwables.propagate() does exactly this:
try { // some code that can throw both checked and runtime exception } catch (Exception e) { throw Throwables.propagate(e); }
UPDATE: This method is now deprecated. See this page for a detailed explanation.