Catch any other exception when importing ROMs and in GUI inform the user.

This commit is contained in:
2025-07-31 04:13:43 +01:00
parent d26000c7c8
commit 078348c054
2 changed files with 20 additions and 6 deletions

View File

@@ -345,9 +345,6 @@ public partial class ImportRoms : ComponentBase
tmpFile,
reader.Entry.Size);
if(File.Exists(tmpFile)) File.Delete(tmpFile);
}
}
try
{
if(File.Exists(tmpFile)) File.Delete(tmpFile);
@@ -360,6 +357,12 @@ public partial class ImportRoms : ComponentBase
#pragma warning restore PH2098
}
}
#pragma warning disable RCS1075, PH2098, ERP022
catch(Exception)
{
// Show must go on
}
#pragma warning restore RCS1075, PH2098, ERP022
finally
{
Interlocked.Increment(ref _listPosition);

View File

@@ -443,9 +443,6 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
tmpFile,
reader.Entry.Size);
if(File.Exists(tmpFile)) File.Delete(tmpFile);
}
}
try
{
if(File.Exists(tmpFile)) File.Delete(tmpFile);
@@ -458,6 +455,20 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
#pragma warning restore PH2098
}
}
catch(Exception)
{
Dispatcher.UIThread.Post(() => Importers.Add(new RomImporter
{
Filename = Path.GetFileName(archive),
Indeterminate = false,
Progress = 1,
Maximum = 1,
Minimum = 0,
StatusMessage = "Error processing archive."
}));
#pragma warning disable ERP022
}
#pragma warning restore ERP022
finally
{
Interlocked.Increment(ref _listPosition);