Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
log gemspec load failures and continue
Browse files Browse the repository at this point in the history
this should produce useful logs instead of crashing while the nightly
sync task is running
  • Loading branch information
indirect committed Aug 21, 2016
1 parent 5b30df3 commit 483305a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/bundler_api/gem_helper.rb
Expand Up @@ -31,6 +31,9 @@ def download_spec
@mutex.synchronize do
@gemspec ||= Marshal.load(Gem.inflate(fetch(url)))
end
rescue => e
STDERR.puts "[Error] Downloading gemspec #{full_name} failed! #{e.class}: #{e.message}"
STDERR.puts e.backtrace.join("\n ")
end

def download_checksum
Expand Down
3 changes: 3 additions & 0 deletions lib/bundler_api/update/job.rb
Expand Up @@ -27,7 +27,10 @@ def run
return if @db_helper.exists?(@payload) && !@fix_deps
return if !@db_helper.exists?(@payload) && @fix_deps
log "Adding: #{@payload.full_name}\n"

spec = @payload.download_spec
return unless spec

checksum = @payload.download_checksum unless @fix_deps
@mutex.synchronize do
deps_added = insert_spec(spec, checksum)
Expand Down

0 comments on commit 483305a

Please sign in to comment.