Skip to content

Instantly share code, notes, and snippets.

@Raouf25
Created April 10, 2020 17:00
Show Gist options
  • Save Raouf25/e0c1af2b58a7a9a99b2d716f4cc7a710 to your computer and use it in GitHub Desktop.
Save Raouf25/e0c1af2b58a7a9a99b2d716f4cc7a710 to your computer and use it in GitHub Desktop.
private <T, R, E extends Exception>
Function<T, R> wrapper(FunctionWithException<T, R, E> fun) {
return arg -> {
try {
return fun.apply(arg);
} 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