You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/19 07:17:17 UTC

[camel] 04/09: (chores) camel-bean: use standard check for exception type in catch blocks

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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 99c4ba1c52958350851c53a30379e2e11b6bf4ca
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 18 16:50:12 2022 +0200

    (chores) camel-bean: use standard check for exception type in catch blocks
---
 .../src/main/java/org/apache/camel/language/bean/BeanExpression.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java
index 21a27d7b882..4ed09b828d7 100644
--- a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java
+++ b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java
@@ -201,10 +201,9 @@ public class BeanExpression implements Expression, Predicate {
                 // regular non ognl invocation
                 return invokeBean(beanHolder, beanName, method, exchange);
             }
+        } catch (RuntimeBeanExpressionException e) {
+            throw e;
         } catch (Exception e) {
-            if (e instanceof RuntimeBeanExpressionException) {
-                throw (RuntimeBeanExpressionException) e;
-            }
             throw new RuntimeBeanExpressionException(exchange, getBeanName(exchange, beanName, beanHolder), method, e);
         }
     }