Created
January 29, 2015 15:09
-
-
Save fge/556451f94d685738e499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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