mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Don't crash if data source unreachable
Closes gh-26.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user