Exception debugging should use Error stream

This commit is contained in:
Matt Nadareski
2025-07-31 09:14:21 -04:00
parent ddbd396b6b
commit ad449c2e33
21 changed files with 41 additions and 41 deletions

View File

@@ -53,7 +53,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -68,7 +68,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return protections;
}
@@ -166,7 +166,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return protections;
}
@@ -302,7 +302,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
// Prepare the returned protections
@@ -312,7 +312,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return [];
}
}

View File

@@ -53,7 +53,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -88,7 +88,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -96,7 +96,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -33,7 +33,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return null;

View File

@@ -56,7 +56,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
@@ -89,7 +89,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -97,7 +97,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#endif
@@ -169,7 +169,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}
@@ -237,7 +237,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -349,7 +349,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return [];
}
}

View File

@@ -81,7 +81,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -89,7 +89,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#else

View File

@@ -33,7 +33,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return null;

View File

@@ -60,7 +60,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#else
@@ -109,7 +109,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
return true;
@@ -135,7 +135,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return true;

View File

@@ -37,7 +37,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return null;

View File

@@ -37,7 +37,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return null;

View File

@@ -34,7 +34,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return null;

View File

@@ -58,7 +58,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#else
@@ -106,7 +106,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
return true;
@@ -132,7 +132,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
return true;

View File

@@ -71,7 +71,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -79,7 +79,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#else

View File

@@ -178,7 +178,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
// Only return if there are protections found

View File

@@ -56,7 +56,7 @@ namespace BinaryObjectScanner.FileType
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
#else

View File

@@ -141,7 +141,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -110,7 +110,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}
@@ -165,7 +165,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -173,7 +173,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -78,7 +78,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}
@@ -118,7 +118,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
}
}
@@ -126,7 +126,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -77,7 +77,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}
@@ -92,7 +92,7 @@ namespace BinaryObjectScanner.Packer
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return false;
}
}

View File

@@ -84,7 +84,7 @@ namespace ExtractionTool
}
catch (Exception ex)
{
if (includeDebug) Console.WriteLine(ex);
if (includeDebug) Console.Error.WriteLine(ex);
return;
}