Skip to content

Commit 36c858f

Browse files
committed
A couple more debug places to avoid confusion
1 parent 30361a9 commit 36c858f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

BinaryObjectScanner/Scanner.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ private ProtectionDictionary GetProtectionsImpl(List<string>? paths, int depth)
111111
{
112112
// If we have no paths, we can't scan
113113
if (paths == null || paths.Count == 0)
114+
{
115+
if (_includeDebug) Console.WriteLine("No paths found to scan, skipping...");
114116
return [];
117+
}
115118

116119
// Set a starting starting time for debug output
117120
DateTime startTime = DateTime.UtcNow;
@@ -209,10 +212,10 @@ private ProtectionDictionary GetProtectionsImpl(List<string>? paths, int depth)
209212
_fileProgress?.Report(new ProtectionProgress(reportableFileName, depth, 1, fullProtection ?? string.Empty));
210213
}
211214

212-
// Throw on an invalid path
215+
// Invalid path
213216
else
214217
{
215-
Console.WriteLine($"{path} is not a directory or file, skipping...");
218+
if (_includeDebug) Console.Error.WriteLine($"{path} is not a directory or file, skipping...");
216219
//throw new FileNotFoundException($"{path} is not a directory or file, skipping...");
217220
}
218221
}
@@ -237,7 +240,10 @@ private ProtectionDictionary GetInternalProtections(string file, int depth)
237240
{
238241
// Quick sanity check before continuing
239242
if (!File.Exists(file))
243+
{
244+
if (_includeDebug) Console.WriteLine($"{file} does not exist, skipping...");
240245
return [];
246+
}
241247

242248
// Open the file and begin scanning
243249
try

0 commit comments

Comments
 (0)