@@ -37,6 +37,7 @@ internal static class Global
3737
3838
3939 public static bool UseIdlePriority = false ;
40+ public static bool ShowErrorAlerts = true ;
4041
4142 public static long MaxFileSizeMB = 2048 ;
4243
@@ -132,6 +133,7 @@ private static void Main()
132133
133134
134135 Global . UseIdlePriority = fileConfig . GetTextUpper ( "UseIdlePriority" ) == "TRUE" ; //default is false
136+ Global . ShowErrorAlerts = fileConfig . GetTextUpper ( "ShowErrorAlerts" ) != "FALSE" ; //default is true
135137
136138
137139 Global . MaxFileSizeMB = fileConfig . GetLong ( "MaxFileSizeMB" ) ?? Global . MaxFileSizeMB ;
@@ -339,6 +341,8 @@ private static IAsyncEnumerable<FileInfo> ProcessSubDirs(DirectoryInfo srcDirInf
339341 }
340342 catch ( Exception ex ) when ( ex is DirectoryNotFoundException || ex is UnauthorizedAccessException )
341343 {
344+ //UnauthorizedAccessException can also occur when a folder was just created, but it can still be ignored here since then file add handler will take care of that folder
345+
342346 fileInfos = Array . Empty < FileInfo > ( ) ;
343347 }
344348
@@ -360,6 +364,8 @@ private static IAsyncEnumerable<FileInfo> ProcessSubDirs(DirectoryInfo srcDirInf
360364 }
361365 catch ( Exception ex ) when ( ex is DirectoryNotFoundException || ex is UnauthorizedAccessException )
362366 {
367+ //UnauthorizedAccessException can also occur when a folder was just created, but it can still be ignored here since then file add handler will take care of that folder
368+
363369 dirInfos = Array . Empty < DirectoryInfo > ( ) ;
364370 }
365371#pragma warning restore S2327
@@ -473,6 +479,7 @@ private static async Task AddMessage(ConsoleColor color, string message, DateTim
473479
474480 if (
475481 showAlert
482+ && Global . ShowErrorAlerts
476483 && ( ConsoleWatch . PrevAlertTime != time || ConsoleWatch . PrevAlertMessage != message )
477484 )
478485 {
@@ -1240,6 +1247,7 @@ public static async Task AddMessage(ConsoleColor color, string message, Context
12401247
12411248 if (
12421249 showAlert
1250+ && Global . ShowErrorAlerts
12431251 && ( PrevAlertTime != context . Time || PrevAlertMessage != message )
12441252 )
12451253 {
@@ -1412,8 +1420,6 @@ public enum PROCESSINFOCLASS : int
14121420
14131421 public enum PROCESSIOPRIORITY : int
14141422 {
1415- PROCESSIOPRIORITY_UNKNOWN = - 1 ,
1416-
14171423 PROCESSIOPRIORITY_VERY_LOW = 0 ,
14181424 PROCESSIOPRIORITY_LOW ,
14191425 PROCESSIOPRIORITY_NORMAL ,
0 commit comments