mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add and use ThrowOnError global (temp)
This commit is contained in:
@@ -73,17 +73,26 @@ namespace SabreTools.Library.FileTypes
|
||||
encounteredErrors = false;
|
||||
ta.Dispose();
|
||||
}
|
||||
catch (EndOfStreamException)
|
||||
catch (EndOfStreamException ex)
|
||||
{
|
||||
// Catch this but don't count it as an error because SharpCompress is unsafe
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
encounteredErrors = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
encounteredErrors = true;
|
||||
}
|
||||
|
||||
@@ -164,6 +173,9 @@ namespace SabreTools.Library.FileTypes
|
||||
catch (Exception ex)
|
||||
{
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
ms = null;
|
||||
realEntry = null;
|
||||
}
|
||||
@@ -224,6 +236,9 @@ namespace SabreTools.Library.FileTypes
|
||||
catch (Exception ex)
|
||||
{
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -265,6 +280,8 @@ namespace SabreTools.Library.FileTypes
|
||||
catch (Exception ex)
|
||||
{
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return empties;
|
||||
@@ -418,7 +435,10 @@ namespace SabreTools.Library.FileTypes
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
success = false;
|
||||
}
|
||||
finally
|
||||
@@ -598,7 +618,10 @@ namespace SabreTools.Library.FileTypes
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Globals.Logger.Error(ex.ToString());
|
||||
if (Globals.ThrowOnError)
|
||||
throw ex;
|
||||
|
||||
success = false;
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user