Skip to content

Commit

Permalink
Log and ignore EOFErrors when replaying
Browse files Browse the repository at this point in the history
  • Loading branch information
lmarburger committed Feb 7, 2013
1 parent 97cd4be commit 0f2ef80
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/bundler_api_replay/job.rb
Expand Up @@ -13,9 +13,17 @@ def initialize(path, host, port = 80)
def run
http = Net::HTTP.new(@host, @port)
http.request(Net::HTTP::Get.new(@path))
rescue EOFError => e
# Bad responses from crashed hosts raise an EOFError.
# https://gist.github.com/lmarburger/9d063165e57743987a92
logger.warn "EOFError: #{to_s}"
end

def to_s
"BundlerApiReplay::Job: path: #{@path}, port: #{@port}, host: #{@host}"
end

def logger(io = STDOUT)
@logger ||= Logger.new(io)
end
end

0 comments on commit 0f2ef80

Please sign in to comment.