[Groonga-commit] droonga/droonga-engine at dce6391 [master] Raise different errors when failed to fetch catalog, for empty response and empty body

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Mar 27 16:18:45 JST 2015


YUKI Hiroshi	2015-03-27 16:18:45 +0900 (Fri, 27 Mar 2015)

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

  Message:
    Raise different errors when failed to fetch catalog, for empty response and empty body

  Modified files:
    lib/droonga/catalog_fetcher.rb

  Modified: lib/droonga/catalog_fetcher.rb (+5 -1)
===================================================================
--- lib/droonga/catalog_fetcher.rb    2015-03-27 16:12:02 +0900 (e02facb)
+++ lib/droonga/catalog_fetcher.rb    2015-03-27 16:18:45 +0900 (252dd6c)
@@ -22,6 +22,9 @@ require "droonga/catalog/dataset"
 
 module Droonga
   class CatalogFetcher
+    class EmptyResponse < StandardError
+    end
+
     class EmptyCatalog < StandardError
     end
 
@@ -36,7 +39,8 @@ module Droonga
       }
       Droonga::Client.open(@client_options) do |client|
         response = client.request(message)
-        raise EmptyCatalog.new unless response
+        raise EmptyResponse.new unless response
+        raise EmptyCatalog.new unless response["body"]
         response["body"]
       end
     end
-------------- next part --------------
HTML����������������������������...
下载 



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