Add and use ThrowOnError global (temp)

This commit is contained in:
Matt Nadareski
2020-09-15 12:12:13 -07:00
parent ab06bf89f6
commit 91f659dca2
34 changed files with 468 additions and 30 deletions

View File

@@ -63,9 +63,12 @@ namespace SabreTools.Library.DatFiles
// Get the current line, split and parse
svr.ReadNextLine();
}
catch (InvalidDataException)
catch (InvalidDataException ex)
{
Globals.Logger.Warning($"Malformed line found in '{filename}' at line {svr.LineNumber}");
if (Globals.ThrowOnError)
throw ex;
continue;
}
@@ -156,6 +159,9 @@ namespace SabreTools.Library.DatFiles
catch (Exception ex)
{
Globals.Logger.Error(ex.ToString());
if (Globals.ThrowOnError)
throw ex;
return false;
}
@@ -200,6 +206,9 @@ namespace SabreTools.Library.DatFiles
catch (Exception ex)
{
Globals.Logger.Error(ex.ToString());
if (Globals.ThrowOnError)
throw ex;
return false;
}
@@ -293,6 +302,9 @@ namespace SabreTools.Library.DatFiles
catch (Exception ex)
{
Globals.Logger.Error(ex.ToString());
if (Globals.ThrowOnError)
throw ex;
return false;
}