1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 01:49:53 +08:00

Avoid fatal exceptions being thrown on download failure

Closes #4313.
This commit is contained in:
Dean Herbert
2019-02-24 00:33:11 +09:00
Unverified
parent 89a05c086c
commit 4e06d5c7cd
+11 -1
View File
@@ -206,7 +206,17 @@ namespace osu.Game.Beatmaps
PostNotification?.Invoke(downloadNotification);
// don't run in the main api queue as this is a long-running task.
Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning);
Task.Factory.StartNew(() =>
{
try
{
request.Perform(api);
}
catch (Exception e)
{
// no need to handle here as exceptions will filter down to request.Failure above.
}
}, TaskCreationOptions.LongRunning);
BeatmapDownloadBegan?.Invoke(request);
return true;
}