Use when on throw on error to avoid context loss

This commit is contained in:
Matt Nadareski
2021-01-12 15:54:14 -08:00
parent 2e674e23ca
commit 3317aef790
20 changed files with 40 additions and 136 deletions

View File

@@ -108,10 +108,9 @@ namespace SabreTools.DatTools
var parsingDatFile = DatFile.Create(currentPathFormat, datFile, quotes);
parsingDatFile?.ParseFile(currentPath, indexId, keep, statsOnly: statsOnly, throwOnError: throwOnError);
}
catch (Exception ex)
catch (Exception ex) when (!throwOnError)
{
logger.Error(ex, $"Error with file '{currentPath}'");
if (throwOnError) throw ex;
}
}