From ade28621c241b421dec00a85913afa44cc5a3361 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Mon, 26 Jun 2023 19:19:08 +0200 Subject: [PATCH] don't throw away the cause of an exception --- .../src/main/java/org/hibernate/internal/SessionImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index b8d1e5b41e..d868f8b3eb 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -766,7 +766,7 @@ public class SessionImpl .fireEventOnEachListener( event, PersistEventListener::onPersist ); } catch (MappingException e) { - originalException = getExceptionConverter().convert( new IllegalArgumentException( e.getMessage() ) ); + originalException = getExceptionConverter().convert( new IllegalArgumentException( e.getMessage(), e ) ); } catch (RuntimeException e) { originalException = getExceptionConverter().convert( e );