Consolidate some of the throws

This commit is contained in:
Matt Nadareski
2020-09-15 17:09:35 -07:00
parent 74a0c47102
commit 044d70da6e
16 changed files with 58 additions and 175 deletions

View File

@@ -189,9 +189,7 @@ namespace SabreTools.Library.IO
}
catch (Exception ex)
{
if (Globals.ThrowOnError)
throw ex;
Globals.Logger.Warning(ex, $"An exception occurred trying to figure out the format of '{filename}'");
return 0;
}
}
@@ -303,9 +301,7 @@ namespace SabreTools.Library.IO
}
catch (Exception ex)
{
// Don't log file open errors
if (Globals.ThrowOnError)
throw ex;
Globals.Logger.Warning(ex, $"An exception occurred determining file type of '{input}'");
}
return outFileType;