Skip to content

Instantly share code, notes, and snippets.

@fge
Created January 29, 2015 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fge/556451f94d685738e499 to your computer and use it in GitHub Desktop.
Save fge/556451f94d685738e499 to your computer and use it in GitHub Desktop.
package com.github.fge.grappa.debugger.common;
import com.github.fge.lambdas.ThrownByLambdaException;
@FunctionalInterface
public interface ThrowingRunnable
extends Runnable
{
void doRun()
throws Throwable;
@Override
default void run()
{
try {
doRun();
} catch (Error | RuntimeException e) {
throw e;
} catch (Throwable tooBad) {
throw new ThrownByLambdaException(tooBad);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment