Skip to content

Commit 80605ae

Browse files
committed
Fix EndOfStreamException not being catched
1 parent bf0cd1a commit 80605ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Yura/MainWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ private void FileView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
373373
{
374374
file = _bigfile.Read(item.File);
375375
}
376-
catch (FileNotFoundException)
376+
catch (Exception ex) when (ex is FileNotFoundException || ex is EndOfStreamException)
377377
{
378378
MessageBox.Show(Properties.Resources.FilePartNotFoundMessage, Properties.Resources.FilePartNotFound, MessageBoxButton.OK, MessageBoxImage.Error);
379379
return;
@@ -455,7 +455,7 @@ private void ExportBtn_Click(object sender, RoutedEventArgs e)
455455
{
456456
file = _bigfile.Read(item.File);
457457
}
458-
catch (FileNotFoundException)
458+
catch (Exception ex) when (ex is FileNotFoundException || ex is EndOfStreamException)
459459
{
460460
MessageBox.Show(Properties.Resources.FilePartNotFoundMessage, Properties.Resources.FilePartNotFound, MessageBoxButton.OK, MessageBoxImage.Error);
461461
return;
@@ -503,7 +503,7 @@ private void ExportFile(FileViewFile item)
503503
{
504504
file = _bigfile.Read(item.File);
505505
}
506-
catch (FileNotFoundException)
506+
catch (Exception ex) when (ex is FileNotFoundException || ex is EndOfStreamException)
507507
{
508508
MessageBox.Show(Properties.Resources.FilePartNotFoundMessage, Properties.Resources.FilePartNotFound, MessageBoxButton.OK, MessageBoxImage.Error);
509509
return;

0 commit comments

Comments
 (0)