History

Merge pull request #1323 from simon04/download-failed

prepare_deploy: report which download has failed

Simon Legner committed 5 years ago

Commit 634d3c72 parents 3bb9463 959f51e1 file · +10 −4Browse files

Unified · Split

lib/tasks/docs.thor+10−4
@@ -244,11 +244,17 @@ class DocsCLI < Thor · 243 unmodified lines
244244 FileUtils.mkpath(dir)
245245
246246 ['index.json', 'meta.json'].each do |filename|
247− open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}") do |file|
248− mutex.synchronize do
249− path = File.join(dir, filename)
250− File.write(path, file.read)
247+ json = "https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}"
248+ begin
249+ open(json) do |file|
250+ mutex.synchronize do
251+ path = File.join(dir, filename)
252+ File.write(path, file.read)
253+ end
251254 end
255+ rescue => e
256+ puts "Docs -- Failed to download #{json}!"
257+ throw e
252258 end
253259 end
254260