Enable RCS1236 and fix noncompliance

"Use exception filter" (`catch when`)
This commit is contained in:
YoshiRulz 2025-06-24 08:23:17 +10:00
parent 7df0cef0db
commit 002fb15db4
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 12 additions and 10 deletions

View File

@ -462,6 +462,8 @@ dotnet_diagnostic.RCS1195.severity = warning
dotnet_diagnostic.RCS1224.severity = warning
# Add paragraph to documentation comment
dotnet_diagnostic.RCS1226.severity = warning
# Use exception filter
dotnet_diagnostic.RCS1236.severity = warning
# Do not pass non-read-only struct by read-only reference
dotnet_diagnostic.RCS1242.severity = silent

View File

@ -432,10 +432,9 @@ namespace BizHawk.Client.Common
{
return core.Create(cip);
}
catch (Exception e)
catch (Exception e) when (!_config.DontTryOtherCores
&& e is not (MissingFirmwareException or { InnerException: MissingFirmwareException }))
{
if (_config.DontTryOtherCores || e is MissingFirmwareException || e.InnerException is MissingFirmwareException)
throw;
exceptions.Add(e);
}
}

View File

@ -276,14 +276,15 @@ namespace BizHawk.Client.EmuHawk
{
Directory.CreateDirectory(movieFolderPath);
}
catch (Exception movieDirException)
catch (IOException)
{
if (movieDirException is IOException
|| movieDirException is UnauthorizedAccessException)
{
//TO DO : Pass error to user?
}
else throw;
// ignored
//TODO present to user?
}
catch (UnauthorizedAccessException)
{
// ignored
//TODO present to user?
}
var filterset = _movieSession.Movie.GetFSFilterSet();