Skip to content

Commit

Permalink
chore: improve logging for backups (WPB-12113) (#3595)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina authored Nov 7, 2024
1 parent ed80ab9 commit 55863ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class BackupAndRestoreViewModel
restoreFileValidation = RestoreFileValidation.ValidNonEncryptedBackup,
backupRestoreProgress = BackupRestoreProgress.InProgress(PROGRESS_75)
)
when (importBackup(importedBackupPath, null)) {
when (val result = importBackup(importedBackupPath, null)) {
RestoreBackupResult.Success -> {
updateCreationProgress(PROGRESS_75)
delay(SMALL_DELAY)
Expand All @@ -221,10 +221,7 @@ class BackupAndRestoreViewModel
}

is RestoreBackupResult.Failure -> {
appLogger.e(
"Error when restoring the db file. The format or version of the backup is not compatible with this " +
"version of the app"
)
appLogger.e("Error when restoring the backup db file caused by: ${result.failure.cause}")
state = state.copy(
restoreFileValidation = RestoreFileValidation.IncompatibleBackup,
backupRestoreProgress = BackupRestoreProgress.Failed
Expand Down

0 comments on commit 55863ae

Please sign in to comment.