prepare_deploy: report which download has failed
Unified · Split
| @@ -244,11 +244,17 @@ class DocsCLI < Thor · 243 unmodified lines | ||
| 244 | 244 | FileUtils.mkpath(dir) |
| 245 | 245 | |
| 246 | 246 | ['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 | |
| 251 | 254 | end |
| 255 | + rescue => e | |
| 256 | + puts "Docs -- Failed to download #{json}!" | |
| 257 | + throw e | |
| 252 | 258 | end |
| 253 | 259 | end |
| 254 | 260 | |