Skip to content

Commit

Permalink
fix problem with exception handling reported in #1682
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Jul 11, 2023
1 parent de384b2 commit f6fba27
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,18 @@ public CompletionStage<R> getReactiveSingleResultOrNull() {
}

private R convertException(Throwable t) {
if ( t instanceof CompletionException ) {
t = t.getCause();
if ( t instanceof CompletionException && t.getCause() != null ) {
return convertException( t.getCause() );
}
if ( t instanceof HibernateException ) {
else if ( t instanceof HibernateException ) {
throw getSession().getExceptionConverter().convert( (HibernateException) t, getLockOptions() );
}
throw getSession().getExceptionConverter().convert( (RuntimeException) t, getLockOptions() );
else if ( t instanceof RuntimeException ) {
throw getSession().getExceptionConverter().convert( (RuntimeException) t, getLockOptions() );
}
else {
throw new CompletionException( t );
}
}

private LockOptions getLockOptions() {
Expand Down

0 comments on commit f6fba27

Please sign in to comment.