mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +08:00
Merge pull request #4318 from peppy/fix-download-failure-exception
Avoid fatal exceptions being thrown on download failure
This commit is contained in:
commit
b02a4ef764
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user