File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ public SyncLogic(Config config)
1212
1313 public void RunInitialSync ( )
1414 {
15+ if ( ! Directory . Exists ( Config . SourceFolder ) )
16+ throw new DirectoryNotFoundException ( $ "Source folder '{ Config . SourceFolder } ' no longer exists") ;
17+ if ( ! Directory . Exists ( Config . BackupFolder ) )
18+ throw new DirectoryNotFoundException ( $ "Backup folder '{ Config . BackupFolder } ' no longer exists") ;
19+ if ( ! Directory . Exists ( Config . LogFilePath ) )
20+ throw new DirectoryNotFoundException ( $ "Log file path '{ Config . LogFilePath } ' no longer exists") ;
21+
1522 CheckForMissingDirs ( ) ;
1623 CheckForDeletedFiles ( ) ;
1724 CheckForDeletedDirs ( ) ;
@@ -23,6 +30,12 @@ public void RunSyncLoop()
2330 {
2431 while ( true )
2532 {
33+ if ( ! Directory . Exists ( Config . SourceFolder ) )
34+ throw new DirectoryNotFoundException ( $ "Source folder '{ Config . SourceFolder } ' no longer exists") ;
35+ if ( ! Directory . Exists ( Config . BackupFolder ) )
36+ throw new DirectoryNotFoundException ( $ "Backup folder '{ Config . BackupFolder } ' no longer exists") ;
37+ if ( ! Directory . Exists ( Config . LogFilePath ) )
38+ throw new DirectoryNotFoundException ( $ "Log file path '{ Config . LogFilePath } ' no longer exists") ;
2639 CheckForMissingDirs ( ) ;
2740 CheckForModifiedFiles ( ) ;
2841 CheckForCopiesInSource ( ) ;
You can’t perform that action at this time.
0 commit comments