catch OperationCanceledException

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

View File

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