[Groonga-commit] droonga/droonga-engine at f1e9875 [master] Raise an error when there is no catalog

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 16 19:47:21 JST 2015


YUKI Hiroshi	2015-01-16 19:47:21 +0900 (Fri, 16 Jan 2015)

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

  Message:
    Raise an error when there is no catalog

  Modified files:
    lib/droonga/cluster.rb

  Modified: lib/droonga/cluster.rb (+5 -5)
===================================================================
--- lib/droonga/cluster.rb    2015-01-16 19:46:01 +0900 (55edc66)
+++ lib/droonga/cluster.rb    2015-01-16 19:47:21 +0900 (3cf2d20)
@@ -23,6 +23,9 @@ module Droonga
   class Cluster
     include Loggable
 
+    class NoCatalogLoaded < Error
+    end
+
     attr_accessor :catalog
     attr_writer :on_change
 
@@ -148,11 +151,8 @@ module Droonga
     end
 
     def all_node_names
-      if @catalog
-        @catalog.all_nodes
-      else
-        []
-      end
+      raise NoCatalogLoaded.new unless @catalog
+      @catalog.all_nodes
     end
 
     def create_engine_nodes
-------------- next part --------------
HTML����������������������������...
Descargar 



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