Skip to content

Commit 737da78

Browse files
committed
Merge pull request #359 from ktsharp/master
Adding try-catch around calls in BaseAmqp.php, fixes #358
2 parents 9a0466d + 4b4ebea commit 737da78

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

RabbitMq/BaseAmqp.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,19 @@ public function __construct(AbstractConnection $conn, AMQPChannel $ch = null, $c
6868
public function __destruct()
6969
{
7070
if ($this->ch) {
71-
$this->ch->close();
71+
try {
72+
$this->ch->close();
73+
} catch (\Exception $e) {
74+
// ignore on shutdown
75+
}
7276
}
73-
77+
7478
if ($this->conn && $this->conn->isConnected()) {
75-
$this->conn->close();
79+
try {
80+
$this->conn->close();
81+
} catch (\Exception $e) {
82+
// ignore on shutdown
83+
}
7684
}
7785
}
7886

0 commit comments

Comments
 (0)