[rabbitmq-discuss] Pika - Catch amqp error - Cannot redeclare exchange with different type

Raphaël De GIUSTI raphael.degiusti at guardis.com
Tue Feb 7 13:42:37 GMT 2012


Hi,

I'm using Pika 0.9.5 with python 2.7 successfully, but I'm running into
some issues when it comes to handle errors from the RabbitMQ broker.
I would like to deal programmatically with errors of this kind :

=ERROR REPORT==== 7-Feb-2012::14:13:40 ===
connection <0.25027.3>, channel 1 - error:
{amqp_error,precondition_failed,
            "cannot redeclare exchange 'status' in vhost '/' with different
type, durable, internal or autodelete value",
            'exchange.declare'}

This log is from the rabbitmq log.

I'm using the Pika SelectConnection, and my app is hanging somewhere after
calling channel.exchange_declare and never gets into my callback.

    def on_channel_open(channel):
        channel.exchange_declare(
                    exchange="status",
                    callback=on_exchange_declared)

What would be the way, in this case (and more generally) to "catch" errors
like this one in my code ?


Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120207/94434234/attachment.htm>


More information about the rabbitmq-discuss mailing list