Improved error handling in FabricGameTestHelper ()

This commit is contained in:
modmuss50 2022-11-26 19:58:14 +00:00 committed by GitHub
parent 0efcd39b73
commit 12a01b0610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,6 +101,8 @@ public final class FabricGameTestHelper {
} catch (IllegalAccessException e) {
throw new RuntimeException("Failed to invoke test method (%s) in (%s) because %s".formatted(method.getName(), method.getDeclaringClass().getCanonicalName(), e.getMessage()), e);
} catch (InvocationTargetException e) {
LOGGER.error("Exception occurred when invoking test method {} in ({})", method.getName(), method.getDeclaringClass().getCanonicalName(), e);
if (e.getCause() instanceof RuntimeException runtimeException) {
throw runtimeException;
} else {