Skip to content

Commit 1255393

Browse files
committed
Updater: check for an active internet connection before trying to pull feeds from the web
1 parent 2d149f7 commit 1255393

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

modules/DependencyControl/Updater.moon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class UpdaterBase
1616
[4]: "No remaining feed available to %s %s '%s' from."
1717
[6]: "The %s of %s '%s' failed because no suitable package could be found %s."
1818
[5]: "Skipped %s of %s '%s': Another update initiated by %s is already running."
19+
[7]: "Skipped %s of %s '%s': An internet connection is currently not available."
1920
[10]: "Skipped %s of %s '%s': the update task is already running."
2021
[15]: "Couldn't %s %s '%s' because its requirements could not be satisfied:"
2122
[30]: "Couldn't %s %s '%s': failed to create temporary download directory %s"
@@ -178,6 +179,9 @@ class UpdateTask extends UpdaterBase
178179

179180
return logUpdateError -4
180181

182+
-- check internet connection
183+
return logUpdateError -7 unless dlm\isInternetConnected!
184+
181185
-- get a lock on the updater
182186
success, otherHost = @updater\getLock waitLock
183187
return logUpdateError -5, otherHost unless success

0 commit comments

Comments
 (0)