add a type to the invalid offset error

This commit is contained in:
Ben Osheroff 2015-04-28 11:50:28 -07:00
parent 752123b83e
commit 8e89b75801
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
require 'hermann'
require 'hermann/errors'
if Hermann.jruby?
require 'hermann/provider/java_simple_consumer'
@ -26,7 +27,7 @@ module Hermann
@topic = topic
offset = opts.delete(:offset)
raise "Bad offset: #{offset}" unless valid_offset?(offset)
raise Hermann::Errors::InvalidOffsetError.new("Bad offset: #{offset}") unless valid_offset?(offset)
if Hermann.jruby?
zookeepers, group_id = require_values_at(opts, :zookeepers, :group_id)

View File

@ -24,6 +24,9 @@ module Hermann
# cannot discover brokers from zookeeper
class NoBrokersError < GeneralError; end
# offsets can only be two symbols or a fixnum
class InvalidOffsetError < GeneralError; end
end
end