[devdocsgjs/main: 1174/1867] prepare_deploy: report which download has failed




commit 959f51e6f7bb8856ad1db0669f89bff1bc40d6e8
Author: Simon Legner <Simon Legner gmail com>
Date:   Sun Nov 15 22:10:18 2020 +0100

    prepare_deploy: report which download has failed

 lib/tasks/docs.thor | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor
index 65f62980..5ed3f5cf 100644
--- a/lib/tasks/docs.thor
+++ b/lib/tasks/docs.thor
@@ -244,11 +244,17 @@ class DocsCLI < Thor
           FileUtils.mkpath(dir)
 
           ['index.json', 'meta.json'].each do |filename|
-            open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}";) do |file|
-              mutex.synchronize do
-                path = File.join(dir, filename)
-                File.write(path, file.read)
+            json = "https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}";
+            begin
+              open(json) do |file|
+                mutex.synchronize do
+                  path = File.join(dir, filename)
+                  File.write(path, file.read)
+                end
               end
+            rescue => e
+              puts "Docs -- Failed to download #{json}!"
+              throw e
             end
           end
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]