Skip to content

Commit 8f16d9b

Browse files
committed
throw error if loading all mods fails
1 parent e343a0f commit 8f16d9b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ModAssistant/Pages/Mods.xaml.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,16 @@ public async Task GetAllMods()
164164
{
165165
var resp = await HttpClient.GetAsync(Utils.Constants.BeatModsAPIUrl + "mod");
166166
var body = await resp.Content.ReadAsStringAsync();
167-
AllModsList = JsonSerializer.Deserialize<Mod[]>(body);
167+
168+
try
169+
{
170+
AllModsList = JsonSerializer.Deserialize<Mod[]>(body);
171+
}
172+
catch (Exception e)
173+
{
174+
System.Windows.MessageBox.Show($"{FindResource("Mods:LoadFailed")}.\n\n" + e);
175+
AllModsList = new Mod[] { };
176+
}
168177
}
169178

170179
private void CheckInstallDir(string directory)

0 commit comments

Comments
 (0)