[ 
https://issues.apache.org/jira/browse/CAMEL-12643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542583#comment-16542583
 ] 

ASF GitHub Bot commented on CAMEL-12643:
----------------------------------------

davsclaus closed pull request #2422: CAMEL-12643: Inadequate information for 
handling catch clauses
URL: https://github.com/apache/camel/pull/2422
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitConsumer.java
 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitConsumer.java
index b30a05171e7..e6a07296dcd 100644
--- 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitConsumer.java
+++ 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitConsumer.java
@@ -268,7 +268,7 @@ public void handleShutdownSignal(String consumerTag, 
ShutdownSignalException sig
                     reconnect();
                     connected = true;
                 } catch (IOException | TimeoutException e) {
-                    log.warn("Unable to obtain a RabbitMQ channel. Will try 
again");
+                    log.warn("Unable to obtain a RabbitMQ channel. Will try 
again." + " Caused by: " + e.getMessage());
 
                     Integer networkRecoveryInterval = 
consumer.getEndpoint().getNetworkRecoveryInterval();
                     final long connectionRetryInterval = 
networkRecoveryInterval != null && networkRecoveryInterval > 0


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> camel-rabbitmq - Inadequate information for handling catch clauses
> ------------------------------------------------------------------
>
>                 Key: CAMEL-12643
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12643
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-rabbitmq
>            Reporter: Zhenhao Li
>            Priority: Minor
>
> There are some situations that different exception types are caught, but the 
> handling of those exceptions cannot show the differences between those types. 
> Here are the code snippets which have this problem:
> {code}
> org.apache.camel.component.rabbitmq.*RabbitConsumer*.handleShutdownSignal, 
> *Line 271*
> catch (IOException | TimeoutException e)
> {   log.warn("Unable to obtain a RabbitMQ channel. Will try again");     ...  
>     }
> {code}
> It may cause confusions to the person who is reading the log, the person can 
> not know what exception happened here and cannot distinguish if the exception 
> type is IOException or TimeoutException. Simply adding a full stack trace is 
> able to improve it.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to