cloudamqp / amqp-client.cr

An AMQP 0-9-1 client for Crystal
https://cloudamqp.github.io/amqp-client.cr/
MIT License
69 stars 10 forks source link

Make channel raise `Connection::ClosedException` #46

Closed spuun closed 2 months ago

spuun commented 2 months ago

A Channel#basic_consume with block = true didn't raise any exception if the connection was closed by the broker, the method just returned. This because we only checked if the channel had been closed, not the connection.

This will add check that the connection hasn't been closed in every place where we checked if the channel has been closed, and if the connection has been closed a Connection::ClosedException will be raised.

I've added a few specs, but not all cases are covered.