Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2021-08-11 11:32:18 +0300
committerGitHub <noreply@github.com>2021-08-11 11:32:18 +0300
commit6dcbccab28bb7a50beb3a7a1631a80df44f6d88b (patch)
treee2a194c80941e37126e53cd081801fcc7fc11f35 /Duplicati/Library
parent976173fd4952bd4328d995a253d97cccbd7bcf96 (diff)
parente90eb3b2a3ea0b76a157868870b4fb8a004a34c3 (diff)
Merge pull request #4520 from warwickmm/remote_list_verification_exception
Create custom Exception for remote list verification failures
Diffstat (limited to 'Duplicati/Library')
-rw-r--r--Duplicati/Library/Interface/CustomExceptions.cs16
-rw-r--r--Duplicati/Library/Main/Operation/BackupHandler.cs2
-rw-r--r--Duplicati/Library/Main/Operation/FilelistProcessor.cs8
3 files changed, 21 insertions, 5 deletions
diff --git a/Duplicati/Library/Interface/CustomExceptions.cs b/Duplicati/Library/Interface/CustomExceptions.cs
index 2e0c90262..1dbc0ff63 100644
--- a/Duplicati/Library/Interface/CustomExceptions.cs
+++ b/Duplicati/Library/Interface/CustomExceptions.cs
@@ -183,4 +183,20 @@ namespace Duplicati.Library.Interface
AbortReason = reason;
}
}
+
+ /// <summary>
+ /// An exception indicating that verification of uploaded volumes has failed
+ /// due to extra, missing, or duplicate files.
+ /// </summary>
+ [Serializable]
+ public class RemoteListVerificationException : UserInformationException
+ {
+ public RemoteListVerificationException(string message, string helpId)
+ : base(message, helpId)
+ {}
+
+ public RemoteListVerificationException(string message, string helpId, Exception innerException)
+ : base(message, helpId, innerException)
+ {}
+ }
}
diff --git a/Duplicati/Library/Main/Operation/BackupHandler.cs b/Duplicati/Library/Main/Operation/BackupHandler.cs
index f78246cdd..ef12b94e8 100644
--- a/Duplicati/Library/Main/Operation/BackupHandler.cs
+++ b/Duplicati/Library/Main/Operation/BackupHandler.cs
@@ -156,7 +156,7 @@ namespace Duplicati.Library.Main.Operation
else
FilelistProcessor.VerifyRemoteList(backend, m_options, m_database, m_result.BackendWriter, new string[] { protectedfile });
}
- catch (Exception ex)
+ catch (RemoteListVerificationException ex)
{
if (m_options.AutoCleanup)
{
diff --git a/Duplicati/Library/Main/Operation/FilelistProcessor.cs b/Duplicati/Library/Main/Operation/FilelistProcessor.cs
index 643c0110f..0652020d8 100644
--- a/Duplicati/Library/Main/Operation/FilelistProcessor.cs
+++ b/Duplicati/Library/Main/Operation/FilelistProcessor.cs
@@ -113,7 +113,7 @@ namespace Duplicati.Library.Main.Operation
{
var s = string.Format("Found {0} remote files that are not recorded in local storage, please run repair", extraCount);
Logging.Log.WriteErrorMessage(LOGTAG, "ExtraRemoteFiles", null, s);
- throw new Duplicati.Library.Interface.UserInformationException(s, "ExtraRemoteFiles");
+ throw new RemoteListVerificationException(s, "ExtraRemoteFiles");
}
ISet<string> doubles;
@@ -123,7 +123,7 @@ namespace Duplicati.Library.Main.Operation
{
var s = string.Format("Found remote files reported as duplicates, either the backend module is broken or you need to manually remove the extra copies.\nThe following files were found multiple times: {0}", string.Join(", ", doubles));
Logging.Log.WriteErrorMessage(LOGTAG, "DuplicateRemoteFiles", null, s);
- throw new Duplicati.Library.Interface.UserInformationException(s, "DuplicateRemoteFiles");
+ throw new RemoteListVerificationException(s, "DuplicateRemoteFiles");
}
if (missingCount > 0)
@@ -135,7 +135,7 @@ namespace Duplicati.Library.Main.Operation
s = string.Format("Found {0} files that are missing from the remote storage, please run repair", missingCount);
Logging.Log.WriteErrorMessage(LOGTAG, "MissingRemoteFiles", null, s);
- throw new Duplicati.Library.Interface.UserInformationException(s, "MissingRemoteFiles");
+ throw new RemoteListVerificationException(s, "MissingRemoteFiles");
}
}
@@ -279,7 +279,7 @@ namespace Duplicati.Library.Main.Operation
if (e.Value == RemoteVolumeState.Uploading || e.Value == RemoteVolumeState.Temporary)
database.UnlinkRemoteVolume(e.Key, e.Value);
else
- throw new Exception(string.Format("The remote volume {0} appears in the database with state {1} and a deleted state, cannot continue", e.Key, e.Value.ToString()));
+ throw new RemoteListVerificationException(string.Format("The remote volume {0} appears in the database with state {1} and a deleted state, cannot continue", e.Key, e.Value.ToString()), "AmbiguousStateRemoteFiles");
}
var locallist = database.GetRemoteVolumes();