[Groonga-commit] droonga/fluent-plugin-droonga at 5dc9691 [master] Handle various errors correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 26 16:00:05 JST 2013


YUKI Hiroshi	2013-12-26 16:00:05 +0900 (Thu, 26 Dec 2013)

  New Revision: 5dc969167910a8d6bd6085403b35efd44ac4bd8c
  https://github.com/droonga/fluent-plugin-droonga/commit/5dc969167910a8d6bd6085403b35efd44ac4bd8c

  Message:
    Handle various errors correctly

  Modified files:
    lib/droonga/dispatcher.rb

  Modified: lib/droonga/dispatcher.rb (+9 -4)
===================================================================
--- lib/droonga/dispatcher.rb    2013-12-26 15:58:48 +0900 (445202c)
+++ lib/droonga/dispatcher.rb    2013-12-26 16:00:05 +0900 (9d303a0)
@@ -217,10 +217,15 @@ module Droonga
     def process_input_message(message)
       adapted_message = @input_adapter.adapt(message)
       @distributor.process(adapted_message["type"], adapted_message)
-    rescue Droonga::Catalog::UnknownDataset => error
-      raise UnknownDataset.new(error.dataset)
-    rescue Droonga::Pluggable::UnknownPlugin => error
-      raise UnknownCommand.new(error.command, message["dataset"])
+    rescue StandardError => error
+      case error
+      when Droonga::Catalog::UnknownDataset
+        raise UnknownDataset.new(error.dataset)
+      when Droonga::Pluggable::UnknownPlugin
+        raise UnknownCommand.new(error.command, message["dataset"])
+      else
+        raise error
+      end
     end
 
     def assert_valid_message
-------------- next part --------------
HTML����������������������������...
Download 



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