diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-15 17:26:27 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-18 17:25:05 -0500 |
| commit | 528fa988b54342d3d5372ecf9613b60fc7287613 (patch) | |
| tree | f1f577d19fe80e45d4a15084fa01d54cc2b5afae | |
| parent | 5e569d0107aefe292b76ac0458f9420077f350a0 (diff) | |
error handling for last modified time
| -rw-r--r-- | src/shared/directoryentry.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 84d68675..639392d2 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -224,7 +224,17 @@ void DirectoryEntry::addFromBSA( return;
}
- const auto ft = ToFILETIME(std::filesystem::last_write_time(archivePath));
+ std::error_code ec;
+ const auto lwt = std::filesystem::last_write_time(archivePath, ec);
+ FILETIME ft = {};
+
+ if (ec) {
+ log::warn(
+ "failed to get last modified date for '{}', {}",
+ archivePath, ec.message());
+ } else {
+ ft = ToFILETIME(lwt);
+ }
addFiles(origin, archive.getRoot(), ft, archiveName, order, stats);
|
