[Groonga-commit] droonga/drndump at 293b1dd [master] Wrap internal error by class

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Apr 15 20:11:55 JST 2015


YUKI Hiroshi	2015-04-15 20:11:55 +0900 (Wed, 15 Apr 2015)

  New Revision: 293b1dd6023209bca83925d167b1adcde988c4d8
  https://github.com/droonga/drndump/commit/293b1dd6023209bca83925d167b1adcde988c4d8

  Message:
    Wrap internal error by class

  Modified files:
    lib/drndump/dump_client.rb

  Modified: lib/drndump/dump_client.rb (+7 -1)
===================================================================
--- lib/drndump/dump_client.rb    2015-04-15 19:53:59 +0900 (dad6e18)
+++ lib/drndump/dump_client.rb    2015-04-15 20:11:55 +0900 (def3c3c)
@@ -28,6 +28,12 @@ module Drndump
     class InvalidMessage < StandardError
     end
 
+    class ClientError < StandardError
+      def initialize(error)
+        super(error.inspect)
+      end
+    end
+
     def initialize(params)
       @host     = params[:host]
       @port     = params[:port]
@@ -50,7 +56,7 @@ module Drndump
       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
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index