diff --git a/modules/core/src/main/java/org/apache/synapse/message/store/impl/rabbitmq/RabbitMQProducer.java b/modules/core/src/main/java/org/apache/synapse/message/store/impl/rabbitmq/RabbitMQProducer.java index eca0a1debc..f1ef3197a5 100644 --- a/modules/core/src/main/java/org/apache/synapse/message/store/impl/rabbitmq/RabbitMQProducer.java +++ b/modules/core/src/main/java/org/apache/synapse/message/store/impl/rabbitmq/RabbitMQProducer.java @@ -112,17 +112,17 @@ public boolean storeMessage(MessageContext synCtx) { if (channel != null) { try { channel.close(); - } catch (IOException | TimeoutException exception) { + } catch (Exception channelCloseException) { log.error("Error occurred while closing the malformed channel Error: " + - exception.getLocalizedMessage()); + channelCloseException.getLocalizedMessage()); } } if (connection != null) { try { connection.close(); - } catch (IOException ioException) { + } catch (Exception connectionCloseException) { log.error("Error occurred while closing the malformed connection Error: " + - ioException.getLocalizedMessage()); + connectionCloseException.getLocalizedMessage()); } } channel = null;