Skip to content

Commit

Permalink
Add extra exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aliesbelik committed Oct 29, 2021
1 parent f18b94b commit a181010
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/com/zeroclue/jmeter/protocol/amqp/AMQPSampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Address;
import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.ShutdownSignalException;

public abstract class AMQPSampler extends AbstractSampler implements ThreadListener {

Expand Down Expand Up @@ -438,6 +440,10 @@ protected void cleanup() {
}
} catch (IOException e) {
log.error("Failed to close connection", e);
} catch (AlreadyClosedException e) {
log.error("Connection already closed", e);
} catch (ShutdownSignalException e) {
log.error("Connection shutdown by thread close", e);
}
}

Expand Down

0 comments on commit a181010

Please sign in to comment.