mirror of https://github.com/reiseburo/hermann
add a type to the invalid offset error
This commit is contained in:
parent
752123b83e
commit
8e89b75801
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue