Navigation Menu

Skip to content

Commit

Permalink
Wrap internal error by class
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 15, 2015
1 parent 4d445d0 commit 293b1dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/drndump/dump_client.rb
Expand Up @@ -28,6 +28,12 @@ class NilMessage < StandardError
class InvalidMessage < StandardError
end

class ClientError < StandardError
def initialize(error)
super(error.inspect)
end
end

def initialize(params)
@host = params[:host]
@port = params[:port]
Expand All @@ -50,7 +56,7 @@ def run(options={}, &block)
extra_client_options = options[:client_options] || @client_options || {}
client = Droonga::Client.new(client_options.merge(extra_client_options))
client.on_error = lambda do |error|
on_error(error)
on_error(ClientError.new(error))
end

n_dumpers = 0
Expand Down

0 comments on commit 293b1dd

Please sign in to comment.