[Groonga-commit] droonga/droonga-engine at 1b16029 [master] Raise error for unexpected routing

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 2 18:35:30 JST 2015


YUKI Hiroshi	2015-04-02 18:35:30 +0900 (Thu, 02 Apr 2015)

  New Revision: 1b1602998ccf6b6054bd83d3a8e9e335d573c3e8
  https://github.com/droonga/droonga-engine/commit/1b1602998ccf6b6054bd83d3a8e9e335d573c3e8

  Message:
    Raise error for unexpected routing

  Modified files:
    lib/droonga/farm.rb

  Modified: lib/droonga/farm.rb (+10 -0)
===================================================================
--- lib/droonga/farm.rb    2015-04-02 18:34:38 +0900 (8bb8ade)
+++ lib/droonga/farm.rb    2015-04-02 18:35:30 +0900 (1f5cf35)
@@ -22,6 +22,13 @@ module Droonga
   class Farm
     include Deferrable
 
+    class NoSlice < StandardError
+      def initialize(message, extra_informations={})
+        message = "#{message}: #{extra_informations.inspect}"
+        super(message)
+      end
+    end
+
     def initialize(name, catalog, loop, options={})
       @name = name
       @catalog = catalog
@@ -82,6 +89,9 @@ module Droonga
     end
 
     def process(slice_name, message)
+      unles****@slice*****?(slice_name)
+        raise NoSlice.new(slice_name, :message => message, :slices => @slices.keys)
+      end
       @slices[slice_name].process(message)
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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