Navigation Menu

Skip to content

Commit

Permalink
http: handle SystemCallError
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 26, 2015
1 parent 51f1be5 commit 9f6fa6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/grntest/executors/http-executor.rb
Expand Up @@ -41,7 +41,7 @@ def ensure_groonga_ready
n_retried = 0
begin
send_command(command("status"))
rescue SystemCallError
rescue Error
n_retried += 1
sleep(0.1)
retry if n_retried < 10
Expand Down Expand Up @@ -93,6 +93,9 @@ def send_normal_command(command)
open(url, :read_timeout => @read_timeout) do |response|
normalize_response_data(command, response.read)
end
rescue SystemCallError
message = "failed to read response from Groonga: <#{url}>: #{$!}"
raise Error.new(message)
rescue OpenURI::HTTPError
$!.io.read
end
Expand Down

0 comments on commit 9f6fa6a

Please sign in to comment.