[Groonga-commit] droonga/fluent-plugin-droonga at 9aa54f9 [master] Revert changes around run_command

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 26 16:34:42 JST 2013


YUKI Hiroshi	2013-12-26 16:34:42 +0900 (Thu, 26 Dec 2013)

  New Revision: 9aa54f917ca53235f5e6ad5ac1720ed4fdd577ad
  https://github.com/droonga/fluent-plugin-droonga/commit/9aa54f917ca53235f5e6ad5ac1720ed4fdd577ad

  Message:
    Revert changes around run_command

  Modified files:
    lib/droonga/handler_plugin.rb
    lib/droonga/plugin.rb

  Modified: lib/droonga/handler_plugin.rb (+4 -4)
===================================================================
--- lib/droonga/handler_plugin.rb    2013-12-26 16:27:03 +0900 (96727a0)
+++ lib/droonga/handler_plugin.rb    2013-12-26 16:34:42 +0900 (5eae2c7)
@@ -33,11 +33,11 @@ module Droonga
     end
 
     private
-    def process_error(command, error, arguments)
-      if error.is_a?(MessageProcessingError)
-        messenger.error(error.status_code, error.response_body)
-      else
+    def run_command(command, message, messenger)
+      begin
         super
+      rescue MessageProcessingError => error
+        messenger.error(error.status_code, error.response_body)
       end
     end
   end

  Modified: lib/droonga/plugin.rb (+5 -1)
===================================================================
--- lib/droonga/plugin.rb    2013-12-26 16:27:03 +0900 (986bc50)
+++ lib/droonga/plugin.rb    2013-12-26 16:34:42 +0900 (41278b7)
@@ -33,12 +33,16 @@ module Droonga
     end
 
     def process(command, *arguments)
-      __send__(self.class.method_name(command), *arguments)
+      run_command(command, *arguments)
     rescue => exception
       process_error(command, exception, arguments)
     end
     
     private
+    def run_command(command, *arguments)
+      __send__(self.class.method_name(command), *arguments)
+    end
+
     def process_error(command, error, arguments)
       Logger.error("error while processing #{command}",
                    error,
-------------- next part --------------
HTML����������������������������...
다운로드 



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