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

Back to archive index

Kouhei Sutou kou****@clear*****
Mon Jan 19 10:56:35 JST 2015


Cluterはcatalogが必須!(catalogを渡さないほうが悪い)という
ことにして、Clusterではエラーチェックをしない方がスッキリす
るんじゃないかと思いました。

(エラーチェックをするならClusterを作るほうがやる。)

In <f1e98755af11a63529124e616354c94f7b13deda �� jenkins.clear-code.com>
  "[Groonga-commit] droonga/droonga-engine �� f1e9875 [master] Raise an error when there is no catalog" on Fri, 16 Jan 2015 19:47:21 +0900,
  YUKI Hiroshi <null+groonga �� clear-code.com> wrote:

> 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




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