1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 23:53:21 +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
parent 89a05c086c
commit 4e06d5c7cd

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;
}