Improved handling for cases where a delete request returns a FileNotFound exception

This commit is contained in:
Kenneth Skovhede
2015-11-17 12:36:00 +01:00
parent cb8c89d748
commit 70892e8e64
+2 -3
View File
@@ -797,11 +797,10 @@ namespace Duplicati.Library.Main
}
catch (Exception ex)
{
var isFileMissingException = ex is Library.Interface.FileMissingException;
var wex = ex as System.Net.WebException;
var isFileMissingException = ex is Library.Interface.FileMissingException || ex is System.IO.FileNotFoundException;
var wr = ex as System.Net.WebException == null ? null : (ex as System.Net.WebException).Response as System.Net.HttpWebResponse;
if (ex is Library.Interface.FileMissingException || (wr != null && wr.StatusCode == System.Net.HttpStatusCode.NotFound))
if (isFileMissingException || (wr != null && wr.StatusCode == System.Net.HttpStatusCode.NotFound))
{
m_statwriter.AddWarning(LC.L("Delete operation failed for {0} with FileNotFound, listing contents", item.RemoteFilename), ex);
bool success = false;