Skip to content

Commit

Permalink
Catching on file management error
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-fang authored and alex-fang committed Oct 31, 2023
1 parent bf81251 commit b76b527
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/D2L.Bmx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,14 @@
await UpdateChecker.CheckForUpdatesAsync( configProvider.GetConfiguration() );
//Creating new Cache directory and removing old files.
if( !Directory.Exists( BmxPaths.CACHE_DIR ) ) {
Directory.CreateDirectory( BmxPaths.CACHE_DIR );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "awsCredsCache" ) );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "sessions" ) );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "update_check" ) );
try {
Directory.CreateDirectory( BmxPaths.CACHE_DIR );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "awsCredsCache" ) );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "sessions" ) );
File.Delete( Path.Join( BmxPaths.BMX_DIR, "update_check" ) );
} catch ( Exception ex ) {

Check warning on line 225 in src/D2L.Bmx/Program.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest, win, bmx.exe)

The variable 'ex' is declared but never used

Check warning on line 225 in src/D2L.Bmx/Program.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest, osx, bmx)

The variable 'ex' is declared but never used
Console.WriteLine( "Error cleaning up old files continuing..." );
}
}
await next( context );
},
Expand Down

0 comments on commit b76b527

Please sign in to comment.