From 24b0d499842bcad0bc0445158c8782b3bdc819ad Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Wed, 18 Oct 2023 09:58:17 +0200 Subject: [PATCH] WELD-2762 Do not swallow exceptions occuring during HTTP session creation --- .../web/context/beanstore/http/LazySessionBeanStore.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/web/src/main/java/org/jboss/weld/module/web/context/beanstore/http/LazySessionBeanStore.java b/modules/web/src/main/java/org/jboss/weld/module/web/context/beanstore/http/LazySessionBeanStore.java index 13ac3e3950..438b41d7d4 100644 --- a/modules/web/src/main/java/org/jboss/weld/module/web/context/beanstore/http/LazySessionBeanStore.java +++ b/modules/web/src/main/java/org/jboss/weld/module/web/context/beanstore/http/LazySessionBeanStore.java @@ -85,10 +85,10 @@ protected HttpSession getSession(boolean create) { try { return SessionHolder.getSession(request, create); } catch (IllegalStateException e) { - // If container can't create an underlying session, invalidate the - // current one + // If container can't create an underlying session, invalidate the current one detach(); - return null; + // re-throw the exception to properly show cause and message + throw e; } }