windows moment

This commit is contained in:
zznty
2023-02-17 16:32:48 +07:00
parent 5483728a4e
commit 2860dda41b
2 changed files with 16 additions and 2 deletions

View File

@@ -68,7 +68,14 @@ namespace Torch.Managers
if (File.Exists(tempFilePath)) if (File.Exists(tempFilePath))
File.Delete(tempFilePath); File.Delete(tempFilePath);
File.Move(source, tempFilePath); try
{
File.Move(source, tempFilePath);
}
catch (UnauthorizedAccessException)
{
// ignore
}
} }
} }
} }

View File

@@ -109,7 +109,14 @@ namespace Torch.Managers
else else
{ {
_fsManager.SoftDelete(extractPath, file.FullName); _fsManager.SoftDelete(extractPath, file.FullName);
file.ExtractToFile(targetFile, true); try
{
file.ExtractToFile(targetFile, true);
}
catch (Exception e)
{
_log.Warn(e, "unable to extract {0}", targetFile);
}
} }
} }