Improve error handling in rabbitMQ related code.