Skip to content

Commit

Permalink
[Testframework] Fix wrapping GameTestAssertException (#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minecraftschurli authored May 21, 2024
1 parent 66197fe commit 8ac9f9c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.lang.invoke.MethodHandle;
import java.lang.reflect.Method;
import net.minecraft.gametest.framework.GameTest;
import net.minecraft.gametest.framework.GameTestAssertException;
import net.minecraft.gametest.framework.GameTestHelper;
import net.minecraft.network.chat.Component;
import net.neoforged.testframework.TestFramework;
Expand Down Expand Up @@ -38,6 +39,8 @@ public void init(TestFramework framework) {
onGameTest(helperType, helper -> {
try {
handle.invoke(helper);
} catch (GameTestAssertException exception) {
throw exception;
} catch (Throwable exception) {
throw new RuntimeException("Encountered exception running method-based gametest test: " + method, exception);
}
Expand Down

0 comments on commit 8ac9f9c

Please sign in to comment.