Added error handling for amqp lib.