Skip to content

Commit

Permalink
raise downloaderror object resolving #269
Browse files Browse the repository at this point in the history
  • Loading branch information
taf2 committed Dec 28, 2022
1 parent c562c41 commit f6ce37b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/curl/multi.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true
module Curl
class Multi
class DownloadError < RuntimeError
attr_accessor :errors
end
class << self
# call-seq:
# Curl::Multi.get(['url1','url2','url3','url4','url5'], :follow_location => true) do|easy|
Expand Down Expand Up @@ -241,7 +244,11 @@ def download(urls,easy_options={},multi_options={},download_paths=nil,&blk)
errors << e
end
}
raise errors unless errors.empty?
if errors.any?
de = Curl::Multi::DownloadError.new
de.errors = errors
raise de
end
end
end

Expand Down

0 comments on commit f6ce37b

Please sign in to comment.