Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 253acbe

Browse files
author
eightgran
committed
Use try-catch when creating Directory instances
- Improve error handling
1 parent 36586da commit 253acbe

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/controller/backup_storage.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,18 @@ class BackupStorage {
126126
/// Creates all directories required to store and retrieve backup files.
127127
void _createStorageDir(String path) async {
128128
if (useShortDirectoryNaming) {
129-
Directory('$path/$applicationName').create();
129+
try {
130+
Directory('$path/$applicationName').create();
131+
} catch (e) {
132+
print(e);
133+
}
130134
} else {
131-
Directory('$path/$organizationName').create();
132-
Directory('$path/$organizationName/$applicationName').create();
135+
try {
136+
Directory('$path/$organizationName').create();
137+
Directory('$path/$organizationName/$applicationName').create();
138+
} catch (e) {
139+
print(e);
140+
}
133141
}
134142
}
135143

0 commit comments

Comments
 (0)