Don't crash if data source unreachable
authorgfyoung <redacted>
Thu, 18 May 2017 04:12:21 +0000 (00:12 -0400)
committergfyoung <redacted>
Thu, 18 May 2017 04:17:11 +0000 (00:17 -0400)
Closes gh-26.

updateHostsFile.py

index b9a0ddd204ebbe76259b407d3e3a10037352f5ae..16687a973f1098c697a45ba35a9bd95c80034e06 100644 (file)
@@ -297,9 +297,9 @@ def update_all_sources():
         print("Updating source " + os.path.dirname(
             source) + " from " + update_url)
 
-        updated_file = get_file_by_url(update_url)
-
         try:
+            updated_file = get_file_by_url(update_url)
+
             # get rid of carriage-return symbols
             updated_file = updated_file.replace("\r", "")
 
@@ -309,7 +309,7 @@ def update_all_sources():
             write_data(hosts_file, updated_file)
             hosts_file.close()
         except:
-            print("Skipping.")
+            print("Error in updating source: ", update_url)
 # End Update Logic
 
 
git clone https://git.99rst.org/PROJECT