Skip to content

Commit

Permalink
Log mod download errors before falling back to mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Aug 4, 2024
1 parent 40c0121 commit 3d7f819
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ and only contains the latest changes.
Its purpose is to be shown in Olympus when updating.

#changelog#
∙ Added more mirrors for mod downloads (celestemods.com and weg.fan)
∙ Added a setting allowing to pick the priority between GameBanana and the mirrors
∙ Log mod download errors before falling back to mirrors
5 changes: 3 additions & 2 deletions sharp/CmdInstallMod.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using MonoMod.Utils;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -39,7 +40,7 @@ public override IEnumerator Run(string root, string url, string mirrorPreference
yield return Try(Download(url, 0, zipStream), ea);

if (ea[0] != null) {
yield return Status($"Downloading from {mirroredUrl} failed, trying another mirror", false, "download", false);
yield return Status($"Downloading from {mirroredUrl} failed, trying another mirror.\n" + ea[0], false, "download", false);
continue; // to the next mirror
} else {
break; // out of the loop
Expand Down
1 change: 1 addition & 0 deletions sharp/CmdUpdateAllMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private static IEnumerator tryDownloadWithMirror(ModUpdateInfo info, string mess
Exception lastException = null;

foreach (string url in GetAllMirrorUrls(info.URL, mirrorPreferences)) {
log($"Downloading mod from {url}");
lastException = null;

// download the file from the selected mirror
Expand Down

0 comments on commit 3d7f819

Please sign in to comment.