Skip to content

Commit

Permalink
Raise an exception if no seed brokers are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
dasch committed Feb 10, 2016
1 parent 5b53d6c commit 142ee01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/kafka/broker_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class BrokerPool
# @param connect_timeout [Integer, nil] see {Connection#initialize}.
# @param socket_timeout [Integer, nil] see {Connection#initialize}.
def initialize(seed_brokers:, client_id:, logger:, connect_timeout: nil, socket_timeout: nil)
if seed_brokers.empty?
raise ArgumentError, "At least one seed broker must be configured"
end

@client_id = client_id
@logger = logger
@connect_timeout = connect_timeout
Expand Down

0 comments on commit 142ee01

Please sign in to comment.