Skip to content

Commit

Permalink
Catch AlreadyClosedException separatly so that if it is another kind …
Browse files Browse the repository at this point in the history
…of ShutdownSignalException, we can log more details
  • Loading branch information
stampy88 committed Jan 7, 2011
1 parent 9901cc2 commit b5ea6c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/amqp/AmqpClient.java
Expand Up @@ -17,6 +17,7 @@
*/
package amqp;

import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
Expand Down Expand Up @@ -194,6 +195,8 @@ protected void closeChannelSilently(Channel channel) {
channel.close();
} catch (IOException e) {
LOG.warn("Problem closing down channel", e);
} catch (AlreadyClosedException e) {
LOG.debug("Channel was already closed");
} catch (ShutdownSignalException e) {
// we can ignore this since we are shutting down
LOG.debug("Got a shutdown signal while closing channel", e);
Expand All @@ -208,6 +211,8 @@ private void closeConnectionSilently(Connection connection) {
connection.close();
} catch (IOException e) {
LOG.warn("Problem closing down connection", e);
} catch (AlreadyClosedException e) {
LOG.debug("Connection was already closed");
} catch (ShutdownSignalException e) {
// we can ignore this since we are shutting down
LOG.debug("Got a shutdown signal while closing connection", e);
Expand Down

0 comments on commit b5ea6c7

Please sign in to comment.