Skip to content

Commit

Permalink
add try-catches for #229
Browse files Browse the repository at this point in the history
fixes #229
  • Loading branch information
TheLastGimbus committed Sep 12, 2023
1 parent 1760493 commit 6a7c6c4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/moving.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,18 @@ Stream<int> moveFiles(
'(not supported on Windows) - will be set to 1970-01-01');
time = DateTime(1970);
}
await result.setLastModified(time);
try {
await result.setLastModified(time);
} on OSError catch (e) {
// Sometimes windoza throws error but successes anyway 🙃:
// https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/issues/229#issuecomment-1685085899
// That's why this is here
if (e.errorCode != 0) {
print("WARNING: Can't set modification time on $result: $e");
}
} catch (e) {
print("WARNING: Can't set modification time on $result: $e");
}

// one copy/move/whatever - one yield
yield ++i;
Expand Down

0 comments on commit 6a7c6c4

Please sign in to comment.