Remove weird catch logic

This commit is contained in:
Dean Herbert 2023-05-05 21:05:57 +09:00
parent 2a3e03695c
commit 5d78561aa3
1 changed files with 1 additions and 12 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.IO;
using System.Linq;
using System.Threading;
@ -40,10 +39,8 @@ protected override void ExportToStream(TModel model, Stream outputStream, Progre
/// <param name="cancellationToken">The cancellation token.</param>
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
{
try
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
{
using var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate));
int i = 0;
int fileCount = model.Files.Count();
bool fileMissing = false;
@ -78,14 +75,6 @@ private void exportZipArchive(TModel model, Stream outputStream, ProgressNotific
Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error);
}
}
catch (ObjectDisposedException)
{
// outputStream may close before writing when request cancel.
if (cancellationToken.IsCancellationRequested)
return;
throw;
}
}
}
}