From 0fc4294fed06db412ce299539288343d18670f1f Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Wed, 28 Feb 2018 13:20:51 +0200 Subject: [PATCH] HHH-12328 - ByteBuddyInterceptor#intercept should not wrap Exception types --- .../hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java index a5166fdc98..a100367baf 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyInterceptor.java @@ -52,7 +52,7 @@ public class ByteBuddyInterceptor extends BasicLazyInitializer implements ProxyC result = this.invoke( thisMethod, args, proxy ); } catch (Throwable t) { - throw new Exception( t.getCause() ); + throw t instanceof RuntimeException ? t : new Exception( t.getCause() ); } if ( result == INVOKE_IMPLEMENTATION ) { Object target = getImplementation();