This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch context-value-scoped-value-support
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5e70de968d7375ce671571f5e743ded4f5ededb6
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Jan 12 16:05:40 2026 +0100

    Fix exception wrapping in AbstractCamelContextFactoryBean
    
    Rethrow RuntimeException (and subclasses like IllegalArgumentException)
    directly without wrapping. Only wrap checked exceptions in RuntimeException.
    
    This fixes test failures where tests expected IllegalArgumentException
    but were receiving RuntimeException wrapping IllegalArgumentException.
---
 .../java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
 
b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index 4de6db9c274f..666c5d14de10 100644
--- 
a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ 
b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -662,6 +662,8 @@ public abstract class AbstractCamelContextFactoryBean<T 
extends ModelCamelContex
 
             findRouteBuilders();
             installRoutes();
+        } catch (RuntimeException e) {
+            throw e;
         } catch (Exception e) {
             throw new RuntimeException(e);
         }

Reply via email to