catch OperationCanceledException

This commit is contained in:
cdwcgt
2023-02-19 01:45:09 +09:00
parent 309e9b24e2
commit d611603742

View File

@ -76,10 +76,17 @@ namespace osu.Game.Database
notification.CompletionClickAction += () => exportStorage.PresentFileExternally(filename); notification.CompletionClickAction += () => exportStorage.PresentFileExternally(filename);
PostNotification?.Invoke(notification); PostNotification?.Invoke(notification);
try
{
using (var stream = exportStorage.CreateFileSafely(filename)) using (var stream = exportStorage.CreateFileSafely(filename))
{ {
success = await ExportToStreamAsync(model, stream, notification, cancellationToken ?? notification.CancellationToken).ConfigureAwait(false); success = await ExportToStreamAsync(model, stream, notification, cancellationToken ?? notification.CancellationToken).ConfigureAwait(false);
} }
}
catch (OperationCanceledException)
{
success = false;
}
if (!success) if (!success)
{ {