mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-17 08:02:36 +00:00
feature(backup): error handling for the full restore endpoint
This commit is contained in:
parent
7de5d26a81
commit
5e07a9eaeb
|
@ -24,6 +24,7 @@ from selfprivacy_api.backup.tasks import (
|
|||
start_backup,
|
||||
restore_snapshot,
|
||||
prune_autobackup_snapshots,
|
||||
full_restore,
|
||||
)
|
||||
from selfprivacy_api.backup.jobs import (
|
||||
add_backup_job,
|
||||
|
@ -176,7 +177,16 @@ class BackupMutations:
|
|||
This happens in sync with partial merging of old configuration for compatibility
|
||||
"""
|
||||
|
||||
job = add_total_restore_job()
|
||||
try:
|
||||
job = add_total_restore_job()
|
||||
full_restore(job)
|
||||
except Exception as error:
|
||||
return GenericJobMutationReturn(
|
||||
success=False,
|
||||
code=400,
|
||||
message=str(error),
|
||||
job=None,
|
||||
)
|
||||
|
||||
return GenericJobMutationReturn(
|
||||
success=True,
|
||||
|
|
Loading…
Reference in a new issue