1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 23:27:25 +08:00

remove try catch

This commit is contained in:
cdwcgt 2022-12-15 23:20:29 +09:00
parent f5226bd50b
commit dadadaff65
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -140,28 +140,20 @@ namespace osu.Game.Database
/// <param name="notification">The notification will displayed to the user</param>
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification notification)
{
try
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
{
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
float i = 0;
foreach (var file in model.Files)
{
float i = 0;
notification.CancellationToken.ThrowIfCancellationRequested();
foreach (var file in model.Files)
{
notification.CancellationToken.ThrowIfCancellationRequested();
writer.Write(file.Filename, UserFileStorage.GetStream(file.File.GetStoragePath()));
i++;
notification.Progress = i / model.Files.Count();
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
}
writer.Write(file.Filename, UserFileStorage.GetStream(file.File.GetStoragePath()));
i++;
notification.Progress = i / model.Files.Count();
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
}
}
catch (OperationCanceledException)
{
Logger.Log("Export operat canceled");
throw;
}
}
}
}