[Groonga-commit] groonga/grntest [master] Don't stop running HTTP tests when getting response failed from groonga

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 14日 (木) 13:06:03 JST


Haruka Yoshihara	2012-06-14 13:06:03 +0900 (Thu, 14 Jun 2012)

  New Revision: 027d26780dc2b006fdad5c58732398134a9c7839

  Log:
    Don't stop running HTTP tests when getting response failed from groonga

  Modified files:
    lib/groonga/tester.rb

  Modified: lib/groonga/tester.rb (+7 -2)
===================================================================
--- lib/groonga/tester.rb    2012-06-13 11:36:55 +0900 (4c8bd55)
+++ lib/groonga/tester.rb    2012-06-14 13:06:03 +0900 (609fa54)
@@ -767,8 +767,13 @@ EOF
       def send_command(command_line)
         converter = CommandFormatConverter.new(command_line)
         url = "http://#{@host}:#{@port}#{converter.to_url}"
-        open(url) do |response|
-          "#{response.read}\n"
+        begin
+          open(url) do |response|
+            "#{response.read}\n"
+          end
+        rescue OpenURI::HTTPError
+          message = "Failed to get response from groonga: #{$!}: <#{url}>"
+          raise Error.new(message)
         end
       end
 




Groonga-commit メーリングリストの案内
Back to archive index