Skip to content

Instantly share code, notes, and snippets.

@disolovyov
Created January 4, 2013 15:15
Show Gist options
  • Save disolovyov/4453339 to your computer and use it in GitHub Desktop.
Save disolovyov/4453339 to your computer and use it in GitHub Desktop.
package checked.exceptions.suck;
public class RuntimeAllTheThingsHelper {
public interface RuntimeAllTheThings<T> {
T runLikeABoss() throws Exception;
}
public static <T> T runLikeABoss(RuntimeAllTheThings<T> block) {
try {
return block.runLikeABoss();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment