Better handle backup errors (#2132)

This commit is contained in:
Omar Hatem 2025-03-28 16:17:38 +02:00 committed by GitHub
parent c223510438
commit b1e5d1503e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View file

@ -198,7 +198,7 @@ class BackupServiceV3 extends $BackupService {
final version = getVersionFile(file);
switch (version) {
case BackupVersion.unknown:
throw Exception('Invalid backup file: unknown version');
throw Exception('unknown_backup_version');
case BackupVersion.v1:
final data = file.readAsBytesSync();
final backupBytes = data.toList()..removeAt(0);